Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): run PR tests conditionally #1885

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading