Skip to content

Commit

Permalink
chore(ci): run PR tests conditionally (#1885)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Mar 19, 2024
1 parent 3f11930 commit df8e4d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ name: .Tests
on:
workflow_call:
inputs:
### Typical / recommended
### Required
target:
description: PR number, test or prod
required: true
type: string

### Typical / recommended
triggers:
description: Bash array to diff for build triggering; omit to always fire
required: false
type: string
default: test

env:
DOMAIN: apps.silver.devops.gov.bc.ca
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@ jobs:
triggers: ('backend/' 'frontend/' 'migrations/')
params:
--set global.secrets.persist=false

tests:
name: Tests
if: needs.deploys.triggered == 'true'
needs: [deploys]
uses: ./.github/workflows/.tests.yml
with:
target: ${{ github.event.number }}

results:
name: PR Results
if: always() || !failure()
needs: [tests]
runs-on: ubuntu-22.04
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:
tests:
name: Tests
uses: ./.github/workflows/.tests.yml
with:
target: test

zap_scan:
runs-on: ubuntu-latest
Expand Down

0 comments on commit df8e4d4

Please sign in to comment.