This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch github_actions_take_2
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 0c9655e0c4d897d2203366936e0609a262e9dbdc
Author: Tomaz Muraus <[email protected]>
AuthorDate: Sun Dec 13 13:52:20 2020 +0100

    Add pre job.
---
 .github/workflows/main.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e5c8e80..cfc6ba7 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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]

Reply via email to