diff --git a/.github/workflows/generic-testing.yml b/.github/workflows/generic-testing.yml index d5f906b..993d892 100644 --- a/.github/workflows/generic-testing.yml +++ b/.github/workflows/generic-testing.yml @@ -3,22 +3,22 @@ on: workflow_call: inputs: stack-orchestrator-ref: - required: false + required: true type: string ipld-eth-beacon-db-ref: - required: false + required: true type: string ssz-data-ref: - required: false + required: true type: string secrets: GHA_KEY: required: true env: - stack-orchestrator-ref: ${{ inputs.stack-orchestrator-ref || '7fb664270a0ba09e2caa3095e8c91f3fdb5b38af' }} - ipld-eth-beacon-db-ref: ${{ inputs.ipld-eth-beacon-db-ref || '3dfe416302d553f8240f6051c08a7899b0e39e12' }} - ssz-data-ref: ${{ inputs.ssz-data-ref || 'main' }} + stack-orchestrator-ref: ${{ inputs.stack-orchestrator-ref }} + ipld-eth-beacon-db-ref: ${{ inputs.ipld-eth-beacon-db-ref }} + ssz-data-ref: ${{ inputs.ssz-data-ref } GOPATH: /tmp/go jobs: build: diff --git a/.github/workflows/on-publish.yml b/.github/workflows/on-pr-publish.yml similarity index 58% rename from .github/workflows/on-publish.yml rename to .github/workflows/on-pr-publish.yml index 7ed6b38..41b08fe 100644 --- a/.github/workflows/on-publish.yml +++ b/.github/workflows/on-pr-publish.yml @@ -2,9 +2,50 @@ name: Publish Docker image on: release: types: [published, edited] + workflow_dispatch: + inputs: + stack-orchestrator-ref: + description: "The branch, commit or sha from stack-orchestrator to checkout" + required: false + default: "7fb664270a0ba09e2caa3095e8c91f3fdb5b38af" + ipld-eth-beacon-db-ref: + description: "The branch, commit or sha from ipld-eth-beacon-db to checkout" + required: false + default: "3dfe416302d553f8240f6051c08a7899b0e39e12" + ssz-data-ref: + description: "The branch, commit or sha from ssz-data to checkout" + required: false + default: "main" + pull_request: + paths: + - "!**.md" + - "!.gitignore" + - "!LICENSE" + - "!.github/workflows/**" + - ".github/workflows/on-pr.yml" + - ".github/workflows/tests.yml" + - "**" + schedule: + - cron: '0 13 * * *' # Must be single quotes!! 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"]' trigger-tests: uses: ./.github/workflows/generic-testing.yml + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + needs: pre_job with: stack-orchestrator-ref: ${{ github.event.inputs.stack-orchestrator-ref }} ipld-eth-beacon-db-ref: ${{ github.event.inputs.ipld-eth-beacon-db-ref }} @@ -12,6 +53,8 @@ jobs: secrets: GHA_KEY: ${{secrets.GHA_KEY}} system-testing: + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + needs: pre_job uses: ./.github/workflows/system-tests.yml with: stack-orchestrator-ref: ${{ github.event.inputs.stack-orchestrator-ref }} @@ -25,6 +68,11 @@ jobs: needs: - trigger-tests - system-testing + if: | + always() && + (needs.trigger-tests.result == 'success' || needs.trigger-tests.result == 'skipped') && + (needs.system-testing.result == 'success' || needs.system-testing.result == 'skipped') && + github.event_name == 'release' steps: - uses: actions/checkout@v2 - name: Get the version @@ -42,6 +90,10 @@ jobs: name: Push Docker image to Docker Hub runs-on: ubuntu-latest needs: build + if: | + always() && + (needs.build.result == 'success') && + github.event_name == 'release' steps: - name: Get the version id: vars diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml deleted file mode 100644 index f3254a0..0000000 --- a/.github/workflows/on-pr.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Test Application On PR - -on: - workflow_dispatch: - inputs: - stack-orchestrator-ref: - description: "The branch, commit or sha from stack-orchestrator to checkout" - required: false - default: "main" - ipld-eth-beacon-db-ref: - description: "The branch, commit or sha from ipld-eth-beacon-db to checkout" - required: false - default: "main" - ssz-data-ref: - description: "The branch, commit or sha from ssz-data to checkout" - required: false - default: "main" - pull_request: - paths: - - "!**.md" - - "!.gitignore" - - "!LICENSE" - - "!.github/workflows/**" - - ".github/workflows/on-pr.yml" - - ".github/workflows/tests.yml" - - "**" - schedule: - - cron: '0 13 * * *' # Must be single quotes!! - -jobs: - trigger-tests: - if: github.event_name != 'schedule' - uses: ./.github/workflows/generic-testing.yml - with: - stack-orchestrator-ref: ${{ github.event.inputs.stack-orchestrator-ref }} - ipld-eth-beacon-db-ref: ${{ github.event.inputs.ipld-eth-beacon-db-ref }} - ssz-data-ref: ${{ github.event.inputs.ssz-data-ref }} - secrets: - GHA_KEY: ${{secrets.GHA_KEY}} - system-testing: - uses: ./.github/workflows/system-tests.yml - with: - stack-orchestrator-ref: ${{ github.event.inputs.stack-orchestrator-ref }} - ipld-eth-beacon-db-ref: ${{ github.event.inputs.ipld-eth-beacon-db-ref }} - secrets: - GHA_KEY: ${{secrets.GHA_KEY}} - BC_ADDRESS: ${{secrets.BC_ADDRESS}}