Skip to content

Commit

Permalink
CI reenable skip with concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Jul 19, 2024
1 parent 8f232f0 commit 09950a4
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@ on:
- release
- workflow_dispatch

# cancel the current workflow if another commit was pushed on the same PR or reference
# uses the GitHub workflow name to avoid collision with other workflows running on the same PR/reference
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
# see: https://github.com/fkirc/skip-duplicate-actions
# skip_duplicate:
# continue-on-error: true
# runs-on: ubuntu-latest
# outputs:
# should_skip: ${{ steps.skip_duplicate.outputs.should_skip }}
# steps:
# - uses: fkirc/skip-duplicate-actions@master
# with:
# concurrent_skipping: "same_content_newer"
# skip_after_successful_duplicate: "true"
# do_not_skip: '["pull_request", "workflow_dispatch", "schedule", "release"]'
skip_duplicate:
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_duplicate.outputs.should_skip && ! contains(github.ref, 'refs/tags') }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
skip_after_successful_duplicate: "true"
do_not_skip: '["pull_request", "workflow_dispatch", "schedule", "release"]'

# see: https://github.com/actions/setup-python
tests:
#needs: skip_duplicate
#if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }}
needs: skip_duplicate
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-failure }}
env:
Expand Down Expand Up @@ -67,7 +74,7 @@ jobs:
with:
fetch-depth: "0"
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
if: ${{ matrix.python-version != 'None' }}
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -106,7 +113,7 @@ jobs:
with:
fetch-depth: "0"
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build Distribution Package
Expand Down

0 comments on commit 09950a4

Please sign in to comment.