gta news post #3195
Workflow file for this run
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: PR Tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: primary-tests-${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install project dependencies | |
run: yarn --prefer-offline | |
- name: Jest Tests | |
run: yarn jest | |
- name: Build static site | |
run: yarn build | |
- name: Serve and Check Links | |
# Looks weird, but this works significantly better than running it | |
# through a single node process | |
run: yarn run serve & (sleep 5 && yarn run links:internal) | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
with: | |
start: yarn serve | |
wait-on: "http://localhost:8080" | |
- name: Upload Cypress Screenshots | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
if-no-files-found: ignore | |
- name: Upload Cypress Videos | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress-videos | |
path: cypress/videos | |
if-no-files-found: ignore |