Skip to content

Commit

Permalink
Move cypress jobs into .tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jan 18, 2024
1 parent eaa089b commit cacb231
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: .Tests

on:
workflow_call:
inputs:
### Required
target:
description: PR number, test or prod
required: true
type: string

jobs:
cypress-e2e:
name: Cypress end to end test
needs: [deploys]
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [chrome, edge]
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v5
name: Cypress run
with:
config: pageLoadTimeout=10000,baseUrl=https://pubcode-${{ inputs.target }}.apps.silver.devops.gov.bc.ca/
working-directory: ./frontend
browser: ${{ matrix.browser }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: ./frontend/cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
21 changes: 3 additions & 18 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,9 @@ jobs:
cypress-e2e:
name: Cypress end to end test
needs: [deploys]
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [ chrome, firefox, edge ]
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v5
name: Cypress run
with:
config: pageLoadTimeout=10000,baseUrl=https://pubcode-test.apps.silver.devops.gov.bc.ca/
working-directory: ./frontend
browser: ${{ matrix.browser }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: ./frontend/cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
uses: ./.github/workflows/.tests.yml
with:
target: test

deploys-prod:
name: PROD Deployments
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,6 @@ jobs:
cypress-e2e:
name: Cypress end to end test
needs: [deploys]
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [chrome, edge]
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v5
name: Cypress run
with:
config: pageLoadTimeout=10000,baseUrl=https://pubcode-${{ github.event.number }}.apps.silver.devops.gov.bc.ca/
working-directory: ./frontend
browser: ${{ matrix.browser }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: ./frontend/cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
uses: ./.github/workflows/.tests.yml
with:
target: ${{ github.event.number }}

0 comments on commit cacb231

Please sign in to comment.