Cypress Tests #116
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: Cypress Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
pr-number: | |
description: Pull request number | |
required: false | |
type: string | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-22.04 | |
#outputs: | |
# PR_NUMBER: ${{ steps.vars.outputs.PR_ NUMBER}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: cache | |
uses: actions/cache@v4 | |
with: | |
path: "tests/functional" | |
key: node-modules-${{ hashFiles('tests/functional/package.json') }} | |
- name: Set variables | |
id: vars | |
env: | |
PR_NUMBER: ${{ github.event.inputs.pr-number }} | |
run: | | |
if [[ "$PR_NUMBER" != '' ]]; then | |
PR_NUMBER=pr-$PR_NUMBER | |
else | |
PR_NUMBER="app" | |
fi | |
- name: cypress install | |
uses: cypress-io/github-action@v6 | |
with: | |
working-directory: '${{ github.workspace }}/tests/functional' | |
env: | |
CYPRESS_keycloakUsername: ${{secrets.keycloakUsername}} | |
CYPRESS_keycloakPassword: ${{secrets.keycloakPassword}} | |
CYPRESS_depEnv: ${{ steps.vars.PR_NUMBER }} | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: '${{ github.workspace }}/tests/functional/screenshots' | |
# mkdir artifacts | |
# cp -r cypress/screenshots artifacts/screenshots | |
# - name: Archive Cypress report | |
#uses: actions/upload-artifact@v2 | |
#with: | |
#name: cypress-report | |
#path: artifacts |