Skip to content

Commit

Permalink
Modify workflow to leverage single build
Browse files Browse the repository at this point in the history
  • Loading branch information
taysea committed Oct 20, 2023
1 parent b8e1297 commit 275178a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/testcafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
APPLITOOLS_DONT_CLOSE_BATCHES: true

jobs:
build-and-test:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -25,24 +25,26 @@ jobs:
working-directory: aries-site
- name: Log Git Repository
run: echo "$GITHUB_REPOSITORY"
# Tests are only run on headless Chrome
- name: Build and run e2e tests on Chrome
if: ${{ github.event.pull_request.head.repo.full_name == 'grommet/hpe-design-system' }}
- name: Create production build
run: yarn build
working-directory: aries-site
test-e2e:
runs-on: ubuntu-latest
needs: build
steps:
- name: Run e2e tests on Chrome
run: yarn test:ci
working-directory: aries-site
- name: Build and run Applitools tests on Chrome
test-applitools:
runs-on: ubuntu-latest
needs: build
steps:
- name: Run Applitools tests on Chrome
if: ${{ github.event.pull_request.head.repo.full_name == 'grommet/hpe-design-system' }}
run: yarn test:applitools
working-directory: aries-site
# Forked repo does not have access to APPLITOOLS_API_KEY
# Just run e2e tests but not snapshots
- name: Build and run e2e tests on Chrome, forked repo
if: ${{ github.event.pull_request.head.repo.full_name != 'grommet/hpe-design-system' }}
run: yarn test:fork
working-directory: aries-site

batch-completion-notification:
needs: build-and-test
needs: test-applitools
if: ${{ github.event.pull_request.head.repo.full_name == 'grommet/hpe-design-system' }}
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions aries-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"export": "yarn build && next export",
"postexport": "node next.postexport.js",
"start": "yarn build-search && next",
"start-server": "yarn build && yarn next start -p 3030",
"start-server": "yarn next start -p 3030",
"test": "yarn build && node src/scripts/start-tests.js",
"test:local": "start-server-and-test start-server 3030 'testcafe chrome'",
"test:local": "start-server-and-test 'yarn build && yarn start-server' 3030 'testcafe chrome'",
"test:fork": "start-server-and-test start-server 3030 'testcafe chrome:headless'",
"test:ci": "start-server-and-test start-server 3030 'testcafe chrome:headless src/tests/'",
"test:applitools": "start-server-and-test start-server 3030 'testcafe chrome:headless src/applitools/'",
"test:windows": "start-server-and-test start-server 3030 \"testcafe chrome\"",
"test:windows": "start-server-and-test \"yarn build && yarn start-server\" 3030 \"testcafe chrome\"",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"build-search": "node src/scripts/site-contents.mjs"
Expand Down

0 comments on commit 275178a

Please sign in to comment.