Update CICD pipeline to skip duplicate tests (#95)
* Update CICD pipeline to skip duplicate tests * fix dependencies * Fix other dep
This commit is contained in:
parent
5ea4b6766a
commit
adf3dd4b6f
7
.github/workflows/on-pr.yaml
vendored
7
.github/workflows/on-pr.yaml
vendored
@ -1,7 +0,0 @@
|
|||||||
name: Docker Build
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run-tests:
|
|
||||||
uses: ./.github/workflows/tests.yml
|
|
@ -2,12 +2,33 @@ name: Publish Docker image
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
pull_request:
|
||||||
jobs:
|
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:
|
run-tests:
|
||||||
|
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||||
|
needs: pre_job
|
||||||
uses: ./.github/workflows/tests.yml
|
uses: ./.github/workflows/tests.yml
|
||||||
build:
|
build:
|
||||||
name: Run docker build
|
name: Run docker build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
always() &&
|
||||||
|
(needs.run-tests.result == 'success' || needs.run-tests.result == 'skipped') &&
|
||||||
|
github.event_name == 'release'
|
||||||
needs: run-tests
|
needs: run-tests
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -25,6 +46,10 @@ jobs:
|
|||||||
push_to_registries:
|
push_to_registries:
|
||||||
name: Push Docker image to Docker Hub
|
name: Push Docker image to Docker Hub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
always() &&
|
||||||
|
(needs.build.result == 'success') &&
|
||||||
|
github.event_name == 'release'
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Get the version
|
- name: Get the version
|
18
.github/workflows/tests.yml
vendored
18
.github/workflows/tests.yml
vendored
@ -7,24 +7,8 @@ env:
|
|||||||
GOPATH: /tmp/go
|
GOPATH: /tmp/go
|
||||||
|
|
||||||
jobs:
|
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:
|
build:
|
||||||
name: Run docker build
|
name: Run docker build
|
||||||
needs: pre_job
|
|
||||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -34,8 +18,6 @@ jobs:
|
|||||||
statediff-unit-test:
|
statediff-unit-test:
|
||||||
name: Run statediff unit tests
|
name: Run statediff unit tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre_job
|
|
||||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
|
||||||
env:
|
env:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
steps:
|
steps:
|
||||||
|
Loading…
Reference in New Issue
Block a user