Skip to content

Commit

Permalink
Update CICD pipeline to skip duplicate tests (#95)
Browse files Browse the repository at this point in the history
* Update CICD pipeline to skip duplicate tests

* fix dependencies

* Fix other dep
  • Loading branch information
abdulrabbani00 authored Jun 17, 2022
1 parent 5ea4b67 commit adf3dd4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/on-pr.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@ name: Publish Docker image
on:
release:
types: [published]
pull_request:
jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# 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@v4
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: "never"
skip_after_successful_duplicate: "true"
do_not_skip: '["workflow_dispatch", "schedule"]'
run-tests:
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
needs: pre_job
uses: ./.github/workflows/tests.yml
build:
name: Run docker build
runs-on: ubuntu-latest
if: |
always() &&
(needs.run-tests.result == 'success' || needs.run-tests.result == 'skipped') &&
github.event_name == 'release'
needs: run-tests
steps:
- uses: actions/checkout@v2
Expand All @@ -25,6 +46,10 @@ jobs:
push_to_registries:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: |
always() &&
(needs.build.result == 'success') &&
github.event_name == 'release'
needs: build
steps:
- name: Get the version
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,8 @@ env:
GOPATH: /tmp/go

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# 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@v4
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: "never"
skip_after_successful_duplicate: "true"
do_not_skip: '["workflow_dispatch", "schedule"]'
build:
name: Run docker build
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -34,8 +18,6 @@ jobs:
statediff-unit-test:
name: Run statediff unit tests
runs-on: ubuntu-latest
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
env:
GO111MODULE: on
steps:
Expand Down

0 comments on commit adf3dd4

Please sign in to comment.