Skip to content

Commit

Permalink
chore: Updated CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Mar 8, 2023
1 parent 9fb29d5 commit fbba998
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 36 deletions.
72 changes: 40 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
PERCY_PARALLEL_TOTAL: 9

jobs:
build-test-app:
name: Build test-app
build-docs-app:
name: Build docs-app for testing
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand All @@ -29,15 +29,15 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build test-app
- name: Build docs-app
run: yarn build:test
working-directory: test-app
working-directory: docs-app

- name: Upload test-app
- name: Upload docs-app
uses: actions/upload-artifact@v3
with:
name: dist
path: test-app/dist
path: docs-app/dist


lint:
Expand All @@ -61,9 +61,9 @@ jobs:
run: yarn lint


test-addon:
name: Test addon
needs: [build-test-app]
test-docs-app:
name: Test docs-app
needs: [build-docs-app]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -110,24 +110,46 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Download test-app
- name: Download docs-app
uses: actions/download-artifact@v3
with:
name: dist
path: test-app/dist
path: docs-app/dist

- name: Run tests
run: npx percy exec -- yarn test:ember --path=dist --test-port=${{ matrix.test-port }}
working-directory: test-app
run: npx percy exec -- yarn test:device --path=dist --test-port=${{ matrix.test-port }}
working-directory: docs-app
env:
DEVICE: ${{ matrix.device }}
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}


test-compatibility:
name: Test compatibility
test-addon:
name: Test addon
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run tests
run: yarn test
working-directory: test-app


test-addon-compatibility:
name: Test addon compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -138,20 +160,9 @@ jobs:
- 'ember-lts-4.8'
- 'ember-release'
- 'ember-beta'
# - 'ember-canary'
- 'ember-canary'
- 'embroider-safe'
# - 'embroider-optimized'
device:
- 'w1-h3'
- 'w2-h3'
- 'w3-h3'
include:
- device: 'w1-h3'
test-port: 7363
- device: 'w2-h3'
test-port: 7364
- device: 'w3-h3'
test-port: 7365
- 'embroider-optimized'
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
Expand All @@ -166,9 +177,6 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

# Test compatibility without Percy
- name: Run tests
run: yarn test:ember-compatibility ${{ matrix.scenario }} --- yarn test:ember --test-port=${{ matrix.test-port }}
run: yarn test:ember-compatibility ${{ matrix.scenario }} --- yarn test
working-directory: test-app
env:
DEVICE: ${{ matrix.device }}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
"test-app"
],
"scripts": {
"build": "yarn workspace ember-container-query run build",
"build:deploy": "yarn workspaces run build",
"build": "concurrently \"npm:build:*\"",
"build:addon": "yarn workspace ember-container-query run build",
"build:docs-app": "yarn workspace docs-app run build",
"changelog": "lerna-changelog",
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"prepare": "yarn build",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"prepare": "yarn build:addon",
"start": "concurrently \"npm:start:*\" --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "yarn workspace ember-container-query run start",
"start:docs-app": "yarn workspace docs-app run start",
"test": "yarn workspaces run test"
Expand Down

0 comments on commit fbba998

Please sign in to comment.