-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
1 deletion.
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,58 @@ | ||
name: Nowcasting App Tests | ||
on: push | ||
jobs: | ||
test: | ||
name: Lint, typecheck & test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
|
||
# Cache node_modules for faster CI runs if the yarn.lock doesn't change change | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-yarn1-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn1- | ||
# Throw an error if the yarn.lock file doesn't match the installed dependencies (rather than updating it in-place, which it does by default locally) | ||
- name: Install | ||
run: cd ./apps/nowcasting-app && yarn install --frozen-lockfile --silent | ||
|
||
- name: End-to-end tests (Cypress) | ||
id: cypress | ||
uses: cypress-io/github-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DB_LOG: false | ||
NEXT_PUBLIC_ENV_NAME: test | ||
with: | ||
build: yarn build | ||
start: yarn test:start | ||
wait-on: http://localhost:3002 | ||
|
||
- name: End-to-end tests Record (Cypress) | ||
if: failure() && steps.cypress.outcome == 'failure' | ||
uses: cypress-io/github-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DB_LOG: false | ||
NEXT_PUBLIC_ENV_NAME: test | ||
# CYPRESS_PROJECT_ID: --- | ||
# CYPRESS_RECORD_KEY: ---- | ||
with: | ||
record: true | ||
start: yarn test:start | ||
wait-on: http://localhost:3002 |
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