Skip to content

Commit

Permalink
ci: force build output
Browse files Browse the repository at this point in the history
[ci build]
  • Loading branch information
nfrasser committed Sep 10, 2024
1 parent 9895a47 commit ca9620e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ jobs:
with:
name: wheels
path: dist
- name: Check for [ci build] in commit message
run: |
if git log -1 --pretty=format:"%B" | grep "\[ci build\]" ; then
echo "force-build=true" >> "$GITHUB_OUTPUT"
else
echo "force-build=false" >> "$GITHUB_OUTPUT"
fi
test:
needs: [lint]
Expand All @@ -63,7 +70,6 @@ jobs:
# https://github.com/actions/setup-python/issues/852
- os: macos-latest
python-version: "3.7"

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -87,9 +93,12 @@ jobs:
run: |
pytest -v --benchmark-disable -n auto
# NOTE: build step only runs on tag builds or when the commit message contains
# "[ci build]" for testing
build:
needs: [test]
if: ${{ startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[ci build]') }}
# needs: [lint, test]
needs: [lint]
if: "startsWith(github.ref, 'refs/tags/') || needs.lint.outputs.force-build == 'true'"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand Down Expand Up @@ -118,6 +127,7 @@ jobs:
name: wheels-${{ runner.os }}
path: dist

# NOTE: release step only runs on tag builds
release:
name: Release
runs-on: ubuntu-latest
Expand Down

0 comments on commit ca9620e

Please sign in to comment.