Skip to content

Commit

Permalink
ci(test): Adjust GitHub test workflow
Browse files Browse the repository at this point in the history
Uses the node16.16.0-chrome107-ff107 image with preinstalled browsers
as well as cypress-io/github-action@v4 for installing app dependencies

Switch to run on push to master/main and on PRs

'npm ci' & 'npm run build/dev' run through locally for node versions:
- 14
- 16
- 18

user option is needed for correct permissions in ci
  • Loading branch information
TheGreatRefrigerator committed Dec 7, 2022
1 parent 43d3c5d commit 61e5aac
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
name: Test webapp
on: [push]
on:
push:
branches:
- master
- main
pull_request:
jobs:
Run-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: cypress/browsers:node16.16.0-chrome107-ff107
options: --user 1001

steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
- name: Set up default config files
run: cd src && cp config-examples/* config && for i in config/*-example.js; do mv -- "$i" "${i%-example.js}.js"; done
- name: Run test target
- name: Cypress install
uses: cypress-io/github-action@v4
with:
runTests: false
- name: Cypress info
run: npx cypress info
- name: Run tests
env:
ORSKEY: ${{ secrets.ORSKEY }}
BITLYLOGIN: ${{ secrets.BITLYLOGIN }}
BITLYAPIKEY: ${{ secrets.BITLYAPIKEY }}
uses: GIScience/github-action-webapp-front-end-test@v1.4
with:
target: 'test'
run: npm run test:ci

0 comments on commit 61e5aac

Please sign in to comment.