Skip to content

Commit

Permalink
Modify actions workflow conditions
Browse files Browse the repository at this point in the history
This makes the workflow run on every pull request, this is helpful because it gives visibility to the maintainers that the tests are indeed passing before merging the PR. The publishing job is only run when a tag is given
  • Loading branch information
AH-Merii committed Jul 22, 2023
1 parent b517ca4 commit 0aa13e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
name: Publish BioPandas to PyPI / GitHub

on:
push:
tags:
- "v*"
pull_request:
branches: [ main ]

jobs:
test-style:
name: Run style tests
Expand Down Expand Up @@ -47,7 +47,8 @@ jobs:
run: pytest ./biopandas -sv

build-n-publish:
needs: test-pytest # only runs if tests are passing
needs: [test-pytest,test-style] # only runs if tests are passing
if: startsWith(github.ref, 'refs/tags/v') # Check if the tag starts with 'v'
name: Build and publish to PyPI
runs-on: ubuntu-latest

Expand Down

0 comments on commit 0aa13e3

Please sign in to comment.