Duplicate job check

This commit is contained in:
Abdul Rabbani 2022-06-20 09:57:39 -04:00
parent 1778c0c3f1
commit 12b7200dfb
2 changed files with 27 additions and 8 deletions

View File

@ -1,13 +1,35 @@
name: Publish geth to release
name: Test, Build, and/or Publish
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:
uses: ./.github/workflows/tests.yml
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
needs: pre_job
build:
name: Run docker build and publish
needs: run-tests
if: |
always() &&
(needs.run-tests.result == 'success' || needs.run-tests.result == 'skipped') &&
github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ -25,6 +47,10 @@ jobs:
push_to_registries:
name: Publish assets to Release
runs-on: ubuntu-latest
if: |
always() &&
(needs.build.result == 'success') &&
github.event_name == 'release'
needs: build
steps:
- name: Get the version

View File

@ -1,7 +0,0 @@
name: Build and test
on: [pull_request]
jobs:
run-tests:
uses: ./.github/workflows/tests.yml