Fix CI (#549) #460
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
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- v1 | |
- v2 | |
# npm version tags | |
- /^v\d+.\d+.\d+(?:-(?:alpha|beta|rc)\.\d+)?/ | |
pull_request: | |
schedule: | |
- cron: '0 4 * * 6' # Saturdays at 4am | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Volta | |
uses: volta-cli/action@v4 | |
- name: Get package manager's global cache path | |
id: global-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache package manager's global cache and node_modules | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.global-cache-dir-path.outputs.dir }} | |
node_modules | |
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ | |
hashFiles('**/yarn.lock' | |
) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}- | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
if: | | |
steps.cache-dependencies.outputs.cache-hit != 'true' | |
- name: Lint | |
run: yarn lint | |
test: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
browser: [chrome, firefox] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Volta | |
uses: volta-cli/action@v4 | |
- name: Get package manager's global cache path | |
id: global-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache package manager's global cache and node_modules | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.global-cache-dir-path.outputs.dir }} | |
node_modules | |
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ | |
hashFiles('**/yarn.lock' | |
) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}- | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
if: | | |
steps.cache-dependencies.outputs.cache-hit != 'true' | |
- name: Test | |
run: yarn test:ember --launch ${{ matrix.browser }} | |
floating-dependencies: | |
name: Floating Dependencies | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
browser: [chrome, firefox] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Volta | |
uses: volta-cli/action@v4 | |
- name: Get package manager's global cache path | |
id: global-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache package manager's global cache and node_modules | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.global-cache-dir-path.outputs.dir }} | |
node_modules | |
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ | |
hashFiles('**/yarn.lock' | |
) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}- | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
if: | | |
steps.cache-dependencies.outputs.cache-hit != 'true' | |
- name: Test | |
run: yarn test:ember --launch ${{ matrix.browser }} | |
try-scenarios: | |
name: Tests - ${{ matrix.ember-try-scenario }} | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.allow-failure }} | |
needs: test | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
ember-try-scenario: | |
- ember-lts-3.28 | |
- ember-lts-4.4 | |
- ember-lts-4.8 | |
- ember-lts-4.12 | |
- ember-5.0 | |
- ember-release | |
- ember-default | |
- typescript-3.9 | |
- embroider-safe | |
- embroider-optimized | |
allow-failure: [false] | |
include: | |
- ember-try-scenario: ember-beta | |
allow-failure: true | |
- ember-try-scenario: ember-canary | |
allow-failure: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Volta | |
uses: volta-cli/action@v4 | |
- name: Get package manager's global cache path | |
id: global-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache package manager's global cache and node_modules | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.global-cache-dir-path.outputs.dir }} | |
node_modules | |
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ | |
hashFiles('**/yarn.lock' | |
) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}- | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
if: | | |
steps.cache-dependencies.outputs.cache-hit != 'true' | |
- name: Strip ts-expect-error from tests (for TypeScript 3.7) | |
run: find tests/types -type f -name '*.ts' | xargs sed -i 's/@ts-expect-error/@ts-ignore/g' | |
if: matrix.ember-try-scenario == 'typescript-3.7' | |
- name: Test | |
env: | |
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }} | |
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO |