Add pre job.
@@ -11,10 +11,25 @@ on:
- cron: '0 2 * * *'
jobs:
+ # Special job which skips duplicate jobs
+ pre_job:
+ name: Skip Duplicate Jobs Pre Job
+ # Map a step output to a job output
+ outputs:
+ should_skip: ${{ steps.skip_check.outputs.should_skip }}
+ steps:
+ - id: skip_check
+ uses: fkirc/skip-duplicate-actions@f05289cf5f432138afd3408d79ca931eb0df74c3 # v3.0.0
+ with:
+ github_token: ${{ github.token }}
+
unit_tests:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
+ needs: pre_job
+ if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
+
strategy:
matrix:
python_version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
@@ -42,6 +57,9 @@ jobs:
name: Generate Code Coverage
runs-on: ubuntu-latest
+ needs: pre_job
+ if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
+
strategy:
matrix:
python_version: [3.7]
@@ -68,6 +86,9 @@ jobs:
name: Run various lint checks
runs-on: ubuntu-latest
+ needs: pre_job
+ if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
+
strategy:
matrix:
python_version: [3.7]
@@ -94,6 +115,9 @@ jobs:
name: Build and upload Documentation
runs-on: ubuntu-latest
+ needs: pre_job
+ if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
+
strategy:
matrix:
python_version: [3.7]
