Skip to content

Commit

Permalink
feat: run tests before deploying if triggered by pre-release/release
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Sep 27, 2023
1 parent d613425 commit 017a1eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ concurrency:
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/run-tests.yml
if: github.event_name == 'release' && (github.event.release.prerelease || !github.event.release.prerelease)

deploy:
needs: test
if: always() && (github.event_name != 'release' || needs.test.result == 'success')
runs-on: ubuntu-latest
environment: ${{ github.event_name != 'release' && github.ref_name || github.event.release.prerelease && 'test' || 'prod' }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Run pytests

on:
workflow_call:
pull_request:
branches: ["*"]

Expand Down

0 comments on commit 017a1eb

Please sign in to comment.