Skip to content

Commit

Permalink
Move tests from .deploy to pr-open
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Feb 27, 2024
1 parent 980f639 commit 63e5d4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ on:
required: false
type: string
default: ${{ github.event.number }}
test:
description: Run tests after deployment?
required: false
type: string
default: "true"
triggers:
description: Paths used to trigger a build; e.g. ('./backend/' './frontend/)
required: false
Expand Down Expand Up @@ -66,12 +61,12 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/[email protected]
id: triggers
with:
triggers: ${{ inputs.triggers }}

- uses: actions/checkout@v4
- name: Deploy
if: steps.triggers.outputs.triggered == 'true'
working-directory: ${{ inputs.directory }}
Expand Down Expand Up @@ -116,11 +111,3 @@ jobs:
# Remove old build runs, build pods and deployment pods
oc delete po --field-selector=status.phase==Succeeded || true
tests:
name: Tests
needs: [deploys]
if: inputs.test == 'true' && steps.triggers.outputs.triggered == 'true'
uses: ./.github/workflows/.tests.yml
with:
target: ${{ inputs.release }}
10 changes: 9 additions & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ jobs:
release: ${{ github.event.number }}
triggers: ('backend/', 'frontend/', 'migrations/')

tests:
name: Tests
needs: [deploys]
uses: ./.github/workflows/.tests.yml
with:
target: ${{ inputs.release }}

results:
name: PR Results
needs: [deploys]
needs: [tests]
if: always() && !failure()
runs-on: ubuntu-22.04
steps:
- run: echo "Workflow completed successfully!"

0 comments on commit 63e5d4e

Please sign in to comment.