From 61e5aac8abd299ea5c515a217e75808f2d2b3b9e Mon Sep 17 00:00:00 2001 From: Amandus Butzer Date: Mon, 5 Dec 2022 17:19:39 +0100 Subject: [PATCH] ci(test): Adjust GitHub test workflow 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 --- .github/workflows/test.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3436a27..1878aa31 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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' \ No newline at end of file + run: npm run test:ci