From 26668225493d2111013378e7ccb1f8ab88669d3e Mon Sep 17 00:00:00 2001 From: aalu1418 <50029043+aalu1418@users.noreply.github.com> Date: Fri, 9 Feb 2024 08:10:03 -0700 Subject: [PATCH] testing workflow for bumping solana image --- .github/workflows/dependency-updates.yml | 21 +++++++++++++++++++++ Makefile | 6 +++++- scripts/update-solana.sh | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dependency-updates.yml create mode 100755 scripts/update-solana.sh diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml new file mode 100644 index 000000000..9cdd80bd2 --- /dev/null +++ b/.github/workflows/dependency-updates.yml @@ -0,0 +1,21 @@ +name: DependencyBot +on: + workflow_dispatch: + push: + +jobs: + E2E-Solana-Image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 # checkout branch that it is called from + # - name: check for needed updates + # run: make upgrade-e2e-solana-image + - name: Create pull request + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 + with: + title: "[automated] bump solana dependencies" + branch: bump/dependencies + branch-suffix: timestamp + reviewers: aalu1418 + commit-message: "[automated] bump solana dependencies" + diff --git a/Makefile b/Makefile index 4df0e3b92..7cc70b25a 100644 --- a/Makefile +++ b/Makefile @@ -98,4 +98,8 @@ lint-go-integration-tests: .PHONY: lint-go-relay lint-go-relay: - cd ./pkg && golangci-lint --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-relay-report.xml run || true \ No newline at end of file + cd ./pkg && golangci-lint --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-relay-report.xml run || true + +.PHONY: upgrade-e2e-solana-image +upgrade-e2e-solana-image: + cd ./integration-tests && ../scripts/update-solana.sh diff --git a/scripts/update-solana.sh b/scripts/update-solana.sh new file mode 100755 index 000000000..257d445fa --- /dev/null +++ b/scripts/update-solana.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +testVersion=$(grep -oh "solanalabs/solana:v[0-9]*.[0-9]*.[0-9]*" */**/*.go) +echo "Current E2E Test Version: $testVersion" + +latestTag=$(curl https://api.github.com/repos/solana-labs/solana/releases/latest | jq -r '.tag_name') +latestVersion="solanalabs/solana:$latestTag" +echo "Latest Solana Mainnet Version: $latestVersion" + +if [ "$testVersion" = "$latestVersion" ]; then + echo "E2E Tests Are Up To Date" + exit 0 +fi + +echo "Replacing Solana Image Version" + +if [ "$(uname -s)" = "Darwin" ]; then + sed -i '' -e "s~$testVersion~$latestVersion~" */**/*.go +else + sed -i -e "s~$testVersion~$latestVersion~" */**/*.go +fi + +echo "Done"