Skip to content

Commit cacb231

Browse files
committed
Move cypress jobs into .tests.yml
1 parent eaa089b commit cacb231

File tree

3 files changed

+39
-36
lines changed

3 files changed

+39
-36
lines changed

.github/workflows/.tests

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: .Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
### Required
7+
target:
8+
description: PR number, test or prod
9+
required: true
10+
type: string
11+
12+
jobs:
13+
cypress-e2e:
14+
name: Cypress end to end test
15+
needs: [deploys]
16+
runs-on: ubuntu-22.04
17+
strategy:
18+
matrix:
19+
browser: [chrome, edge]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: cypress-io/github-action@v5
23+
name: Cypress run
24+
with:
25+
config: pageLoadTimeout=10000,baseUrl=https://pubcode-${{ inputs.target }}.apps.silver.devops.gov.bc.ca/
26+
working-directory: ./frontend
27+
browser: ${{ matrix.browser }}
28+
- uses: actions/upload-artifact@v3
29+
if: failure()
30+
with:
31+
name: cypress-screenshots
32+
path: ./frontend/cypress/screenshots
33+
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`

.github/workflows/merge.yml

+3-18
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,9 @@ jobs:
9696
cypress-e2e:
9797
name: Cypress end to end test
9898
needs: [deploys]
99-
runs-on: ubuntu-22.04
100-
strategy:
101-
matrix:
102-
browser: [ chrome, firefox, edge ]
103-
steps:
104-
- uses: actions/checkout@v4
105-
- uses: cypress-io/github-action@v5
106-
name: Cypress run
107-
with:
108-
config: pageLoadTimeout=10000,baseUrl=https://pubcode-test.apps.silver.devops.gov.bc.ca/
109-
working-directory: ./frontend
110-
browser: ${{ matrix.browser }}
111-
- uses: actions/upload-artifact@v3
112-
if: failure()
113-
with:
114-
name: cypress-screenshots
115-
path: ./frontend/cypress/screenshots
116-
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
99+
uses: ./.github/workflows/.tests.yml
100+
with:
101+
target: test
117102

118103
deploys-prod:
119104
name: PROD Deployments

.github/workflows/pr-open.yml

+3-18
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,6 @@ jobs:
115115
cypress-e2e:
116116
name: Cypress end to end test
117117
needs: [deploys]
118-
runs-on: ubuntu-22.04
119-
strategy:
120-
matrix:
121-
browser: [chrome, edge]
122-
steps:
123-
- uses: actions/checkout@v4
124-
- uses: cypress-io/github-action@v5
125-
name: Cypress run
126-
with:
127-
config: pageLoadTimeout=10000,baseUrl=https://pubcode-${{ github.event.number }}.apps.silver.devops.gov.bc.ca/
128-
working-directory: ./frontend
129-
browser: ${{ matrix.browser }}
130-
- uses: actions/upload-artifact@v3
131-
if: failure()
132-
with:
133-
name: cypress-screenshots
134-
path: ./frontend/cypress/screenshots
135-
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
118+
uses: ./.github/workflows/.tests.yml
119+
with:
120+
target: ${{ github.event.number }}

0 commit comments

Comments
 (0)