-
Notifications
You must be signed in to change notification settings - Fork 43
160 lines (159 loc) · 6.29 KB
/
dependency-updates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: DependencyUpdater
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # check every day at midnight UTC
jobs:
E2E-Solana-Image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # checkout branch that it is called from
- name: Check for solana image updates
id: solImage
run: |
make upgrade-e2e-solana-image
image=$(curl https://api.github.com/repos/solana-labs/solana/releases/latest | jq -r '.tag_name')
echo "image=$image" >> "$GITHUB_OUTPUT"
- name: Generate branch name
id: branchName
run: |
echo "name=bump/solana-${{ steps.solImage.outputs.image }}" >> "$GITHUB_OUTPUT"
- name: Check if changes + PR exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head "${{ steps.branchName.outputs.name }}" \
--json title \
--jq 'length')
if ((prs > 0)) || [ -z "$(git status --porcelain)" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- name: "Create new branch if needed"
id: branch
if: '!steps.check.outputs.skip'
env:
SHA: ${{ github.head_ref || github.ref_name }}
run: |
echo "original=$SHA" >> "$GITHUB_OUTPUT"
git branch "${{ steps.branchName.outputs.name }}"
git push origin "${{ steps.branchName.outputs.name }}"
- uses: planetscale/[email protected]
if: '!steps.check.outputs.skip'
with:
commit_message: "[automated] bump solana dependencies"
repo: ${{ github.repository }}
branch: "${{ steps.branchName.outputs.name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Cleanup branch"
if: '!steps.check.outputs.skip'
run: |
git reset --hard
git branch --set-upstream-to=origin/${{ steps.branchName.outputs.name }}
git pull
- name: Create pull request
if: '!steps.check.outputs.skip'
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0
with:
title: "[automated] bump solana image to ${{ steps.solImage.outputs.image }}"
base: ${{ steps.branch.outputs.original }}
branch: ${{ steps.branchName.outputs.name }}
reviewers: aalu1418
body: |
Latest Solana mainnet release is [\"${{ steps.solImage.outputs.image }}\"](https://github.com/solana-labs/solana/releases/latest)
(run CI by closing + reopening PR)
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/integration-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: Generate branch name
id: branchName
run: |
echo "name=bump/e2e-deps-${{ steps.coreCTF.outputs.version }}" >> "$GITHUB_OUTPUT"
- name: Check if changes + PR exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head "${{ steps.branchName.outputs.name }}" \
--json title \
--jq 'length')
if ((prs > 0)) || [ -z "$(git status --porcelain)" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- name: "Create new branch if needed"
id: branch
if: '!steps.check.outputs.skip'
env:
SHA: ${{ github.head_ref || github.ref_name }}
run: |
echo "original=$SHA" >> "$GITHUB_OUTPUT"
git branch "${{ steps.branchName.outputs.name }}"
git push origin "${{ steps.branchName.outputs.name }}"
- uses: planetscale/[email protected]
if: '!steps.check.outputs.skip'
with:
commit_message: "[automated] bump e2e <> core/integration-tests dependencies"
repo: ${{ github.repository }}
branch: "${{ steps.branchName.outputs.name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Cleanup branch"
if: '!steps.check.outputs.skip'
run: |
git reset --hard
git branch --set-upstream-to=origin/${{ steps.branchName.outputs.name }}
git pull
- 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"
base: ${{ steps.branch.outputs.original }}
branch: ${{ steps.branchName.outputs.name }}
reviewers: aalu1418
body: |
chainlink/integration-tests uses chainlink-testing-framework@${{ steps.coreCTF.outputs.version }}
(run CI by closing + reopening PR)