Skip to content

Commit

Permalink
testing workflow for bumping solana image
Browse files Browse the repository at this point in the history
  • Loading branch information
aalu1418 committed Feb 9, 2024
1 parent bff37c8 commit 2666822
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/dependency-updates.yml
Original file line number Diff line number Diff line change
@@ -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"

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
24 changes: 24 additions & 0 deletions scripts/update-solana.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 2666822

Please sign in to comment.