From e303637c3e796aa59917d2143adc6ce67c3ce9fe Mon Sep 17 00:00:00 2001 From: Aaron Lu <50029043+aalu1418@users.noreply.github.com> Date: Wed, 14 Feb 2024 07:34:30 -0700 Subject: [PATCH] feat: auto bumping e2e test deps (#583) * workflow for bumping solana image * update commit author + PR body * disable on push, enable cron * PR deduplication * trigger re-run * remove on push * add bumping to relayer test CI install * CI: bumping e2e test deps --- .github/workflows/dependency-updates.yml | 64 +++++++++++++++++++++++- Makefile | 4 ++ scripts/update-e2e.sh | 12 +++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100755 scripts/update-e2e.sh diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 63e523c1b..aec240a72 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -38,4 +38,66 @@ jobs: reviewers: aalu1418 commit-message: "[automated] bump solana dependencies" body: "Latest Solana mainnet release is [\"${{ steps.solImage.outputs.image }}\"](https://github.com/solana-labs/solana/releases/latest)" - + E2E-Testing-Dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup go + uses: actions/setup-go@v3 + with: + go-version-file: "go.mod" + check-latest: true + cache: true + # ------ Get CTF version from core ------------ + - uses: actions/checkout@v3 + with: + repository: smartcontractkit/chainlink + ref: develop + path: ./chainlink + - name: Check CTF version in core + id: coreCTF + working-directory: ./chainlink + run: | + cd integration-tests + version=$(go list -m github.com/smartcontractkit/chainlink-testing-framework | awk '{print $NF}') + echo "chainlink/integration-tests CTF: $version" + echo "version=$version" >> "$GITHUB_OUTPUT" + cd ../../ + rm -rf chainlink + # -------- Compare to chainlink-solana/integration-tests -------------- + - name: Check CTF version in chainlink-solana + id: solanaCTF + run: | + cd integration-tests + version=$(go list -m github.com/smartcontractkit/chainlink-testing-framework | awk '{print $NF}') + echo "chainlink-solana/integrationt-tests CTF: $version" + echo "version=$version" >> "$GITHUB_OUTPUT" + - name: Update integration test dependencies + if: ${{ steps.coreCTF.outputs.version != steps.solanaCTF.outputs.version }} + run: | + make upgrade-e2e-core-deps + make gomodtidy + # --------- Build PR if necessary -------------------- + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head "bump/e2e-test-deps-${{ steps.coreCTF.outputs.version }}" \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + - name: Create pull request + if: '!steps.check.outputs.skip' + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 + with: + title: "[automated] bump e2e test deps to match chainlink/integration-tests" + branch: bump/e2e-test-deps-${{ steps.coreCTF.outputs.version }} + author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + reviewers: aalu1418 + commit-message: "[automated] bump e2e <> core/integration-tests dependencies" + body: "chainlink/integration-tests uses chainlink-testing-framework@${{ steps.coreCTF.outputs.version }}" diff --git a/Makefile b/Makefile index 29411da0c..a1adf0dec 100644 --- a/Makefile +++ b/Makefile @@ -103,3 +103,7 @@ lint-go-relay: .PHONY: upgrade-e2e-solana-image upgrade-e2e-solana-image: ./scripts/update-solana.sh + +.PHONY: update-e2e-core-deps +upgrade-e2e-core-deps: + cd ./integration-tests && ../scripts/update-e2e.sh diff --git a/scripts/update-e2e.sh b/scripts/update-e2e.sh new file mode 100755 index 000000000..35c28d0af --- /dev/null +++ b/scripts/update-e2e.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +# get current develop branch sha +SHA=$(curl https://api.github.com/repos/smartcontractkit/chainlink/commits/develop | jq -r '.sha') +echo "Chainlink Develop Commit: $SHA" + +# update dependencies +go get github.com/smartcontractkit/chainlink/integration-tests@$SHA +go mod tidy +go get github.com/smartcontractkit/chainlink/v2@$SHA +go mod tidy