Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Run Cypress tests

Run Cypress tests #3

Workflow file for this run

name: Run Cypress tests
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
IDENTIFIERS_API_KEY:
required: true
IDENTIFIERS_API_BASE_URL:
required: true
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests against'
required: true
type: environment
concurrency:
group: ${{ github.workflow }}
env:
NODE_VERSION: 18.x
jobs:
cypress-tests:
name: Run Cypress Tests
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
defaults:
run:
working-directory: Dfe.Identifiers.Api.CypressTests/
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Npm install
run: npm install
- name: Run Cypress (${{ inputs.environment }})
if: inputs.environment == 'staging' || inputs.environment == 'development'
run: npm run cy:run -- --env apiKey="${{ secrets.IDENTIFIERS_API_KEY }}",url="${{ secrets.IDENTIFIERS_API_BASE_URL }}"