-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.38 KB
/
test-isolated-ui-cypress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Run Cypress UI tests on isolated environment
on:
pull_request:
branches: [ main, '**-feature' ]
types: [ opened, synchronize, reopened]
push:
branches: [ main ]
env:
NODE_VERSION: 18.13.0
LAST_COMMIT_SHA: default
BRANCH_NAME: main
jobs:
cypress:
name: Set up container and run tests
runs-on: ubuntu-22.04
environment: development
defaults:
run:
working-directory: tests/DFE.FindInformationAcademiesTrusts.CypressTests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- if: github.event_name == 'pull_request'
name: Get source branch for pull request
run: |
GIT_REF=${{ github.head_ref }}
echo "BRANCH_NAME=${GIT_REF}" >> $GITHUB_ENV
- name: Set SHA environment variable
run: |
echo "LAST_COMMIT_SHA=${GITHUB_SHA:(-7)}" >> $GITHUB_ENV
- name: Install dependencies
run: npm install
- name: Start services
working-directory: ./docker
run: docker compose -f docker-compose.ci.yml up -d
- name: Run the cypress tests
run: npm run cy:run -- --env url=http://localhost,authKey=TestSuperSecret
- name: Stop services
if: always()
working-directory: ./docker
run: docker compose -f docker-compose.ci.yml stop