-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create reusable workflow for Ember.js add-ons
- Loading branch information
1 parent
b021d34
commit f47d3f9
Showing
1 changed file
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
nodejs_version: | ||
description: Version of Node.js to use. | ||
default: '12' | ||
required: false | ||
type: string | ||
# Currently, Arrays cannot be passed as inputs so the trick is to pass them as string and then | ||
# decode them with `fromJSON()` to rebuild the string as an Array. | ||
# https://colinsalmcorner.com/musings-on-reusable-workflows/#array-hack | ||
ember_try_scenarios: | ||
description: Custom ember-try scenarios to run. | ||
default: "[ | ||
'ember-lts-3.16', | ||
'ember-lts-3.20', | ||
'ember-release', | ||
'ember-classic', | ||
'ember-default-with-jquery', | ||
'embroider-safe', | ||
'embroider-optimized', | ||
]" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
lint_tests: | ||
name: Lint and tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
cache: yarn | ||
node-version: ${{ inputs.nodejs_version }} | ||
|
||
# https://github.com/lirantal/lockfile-lint | ||
- name: Lint lockfile | ||
run: > | ||
npm_config_yes=true npx lockfile-lint | ||
--path yarn.lock | ||
--allowed-hosts npm yarn | ||
--validate-https | ||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run Lint | ||
run: yarn run lint | ||
|
||
- name: Run Tests | ||
run: yarn run test:ember | ||
|
||
floating: | ||
name: Floating Dependencies | ||
needs: lint_tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
cache: yarn | ||
node-version: ${{ inputs.nodejs_version }} | ||
|
||
- name: Install Dependencies | ||
run: yarn install --no-lockfile --non-interactive | ||
|
||
- name: Run Tests | ||
run: yarn run test:ember | ||
|
||
ember-try-scenarios: | ||
name: ember-try (${{ matrix.try-scenario }}) | ||
needs: lint_tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
try-scenario: ${{ fromJSON(inputs.ember_try_scenarios) }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
cache: yarn | ||
node-version: ${{ inputs.nodejs_version }} | ||
|
||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run Tests | ||
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} |