-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update workflows to cancel previous runs unless the branch is the…
… main branch.
- Loading branch information
Showing
3 changed files
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ on: | |
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
# Cancel running jobs for the same workflow and branch. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
# IMPORTANT: Any new jobs need to be added to the check-docs-passed job to ensure they correctly gate code changes | ||
jobs: | ||
# Test building the docs (html, linkcheck, doctest, coverage) | ||
|
@@ -32,19 +36,19 @@ jobs: | |
- name: Test | ||
run: tox -ve ${{ matrix.tox_env }} | ||
- uses: thedoctor0/[email protected] | ||
if: '!cancelled()' | ||
if: ${{ !cancelled() }} | ||
with: | ||
type: zip | ||
filename: ${{ matrix.tox_env }}_results.zip | ||
path: .results_${{ matrix.tox_env }}/ | ||
- uses: actions/upload-artifact@v3 | ||
if: '!cancelled()' | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: artifact_${{ matrix.tox_env }} | ||
path: ${{ matrix.tox_env }}_results.zip | ||
# Check that all jobs passed | ||
check-docs-passed: | ||
if: always() | ||
if: ${{ !cancelled() }} | ||
needs: [test-docs] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|