Use cypress github action #2
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 UI Test | |
on: | |
workflow_call: | |
inputs: | |
branch: | |
type: string | |
required: true | |
type: | |
type: string | |
required: true | |
node_version: | |
type: string | |
default: "16" | |
workflow_dispatch: | |
inputs: | |
branch: | |
type: string | |
required: true | |
type: | |
type: string | |
required: true | |
node_version: | |
type: string | |
default: "16" | |
jobs: | |
cypress-test: | |
runs-on: ["self-hosted","node-${{ inputs.node_version }}"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
npm ci | |
- name: Cypress test | |
uses: cypress-io/github-action@v6 | |
with: | |
wait-on: 'http://localhost:8080' | |
env: | |
NODE_ENV: production | |
SIERRA_CONFIG: https://cdn.rcsb.org/config/c5aecb46a9fe2698498ed4d1ab1925e9a8fef7f5/profiles/parks/sierra/sierra-base.app.json,https://cdn.rcsb.org/config/c5aecb46a9fe2698498ed4d1ab1925e9a8fef7f5/profiles/parks/sierra/branch/sierra-${{ inputs.branch }}.app.json | |
run: | | |
if [[ ${{ inputs.type }} == 'push' ]]; then | |
npm run runheadless -- --browser chrome | |
elif [[ ${{ inputs.type }} == 'nightly' ]]; then | |
npm run runnightly | |
fi |