From fcc6d6b77d99d040c5f12b76763eaef28320a6f3 Mon Sep 17 00:00:00 2001 From: Rafael Felix Correa Date: Wed, 13 Nov 2024 13:49:27 +0100 Subject: [PATCH] CRIB-542: crib-integration-tests GH workflow running on push to develop Because our crib-integration-tests runs only on schedule, the PR issuer never really gets the feedback that their change broke CRIB when/after merging to develop, and the CRIB team gets notified at most once a day if `develop` is broken. That + timezone differences between team mates can prolong the resolution of the problem. This PR embeds the crib-integration-tests.yml workflow into the already existing build-publish-develop-pr.yml, since `workflow_run` doesn't provide feedback in the context of a PR/push as well (see https://stackoverflow.com/questions/63343937/how-to-use-the-github-actions-workflow-run-event#comment134992476_65081720) we'd have a check running per PR/push to develop but completely detached from the commit ref, which defeats the purpose of establishing a feedback loop. Keeping these workflows splitted would incur in potential race conditions, such as running tests by pulling a docker tag that doesn't yet exist, or worse: exists but with a different content than the one from the actual commit ref. --- .../workflows/build-publish-develop-pr.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/build-publish-develop-pr.yml b/.github/workflows/build-publish-develop-pr.yml index 92d9e0445a6..8b10d03a607 100644 --- a/.github/workflows/build-publish-develop-pr.yml +++ b/.github/workflows/build-publish-develop-pr.yml @@ -154,3 +154,26 @@ jobs: goreleaser-release-type: "merge" goreleaser-config: .goreleaser.develop.yaml goreleaser-key: ${{ secrets.GORELEASER_KEY }} + + crib-integration-test: + if: ${{ github.event.inputs.git_ref || github.ref }} == 'refs/heads/develop' + runs-on: ubuntu-latest + needs: [split, image-tag] + permissions: + id-token: write + steps: + - name: Assume role capable of dispatching action + uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 + id: get-gh-token + with: + aws-role-arn: ${{ secrets.AWS_OIDC_CHAINLINK_CI_AUTO_PR_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + + - uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be #v1.6.5 + with: + owner: smartcontractkit + repo: chainlink + github_token: ${{ steps.get-gh-token.outputs.access-token }} + workflow_file_name: crib-integration-test.yml + client_payload: '{"git_ref": "${{ env.GIT_REF }}", "image-tag": "${{ needs.image-tag.outputs.image-tag }}"}'