-
Notifications
You must be signed in to change notification settings - Fork 495
181 lines (171 loc) · 5.43 KB
/
pre-genesis-transactions-checks.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Check Pre Genesis Transactions 👨🔧
on:
merge_group:
pull_request:
branches:
- main
paths:
- transactions/*.toml
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
packages: write
contents: write
env:
CAN_ADD_VALIDATORS: 'true'
CAN_ADD_BONDS: 'false'
CAN_ADD_ACCOUNTS: 'true'
RUST_BACKTRACE: 1
jobs:
pr-check:
if: ${{ github.event_name == 'pull_request' }}
name: Shallow PR check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Set up cache
uses: actions/cache@v4
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Check PR submission correctness
run: |
source .venv/bin/activate
poetry run python scripts/validate-pr.py
env:
ALIAS: ${{ github.actor }}
merge-check:
runs-on: ubuntu-latest
name: Deep merge check
if: ${{ github.event_name == 'merge_group' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: sigoden/install-binary@v1
with:
repo: anoma/namada
tag: v0.43.0
name: namadac
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Set up cache
uses: actions/cache@v4
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Check PR submission correctness
run: |
source .venv/bin/activate
poetry run python scripts/validate-merge.py
main:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
name: Rebuild genesis README
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_SK }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Set up cache
uses: actions/cache@v4
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Rebuild README.md
run: |
source .venv/bin/activate
poetry run python scripts/rebuild.py
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[skip ci] rebuild genesis readme"
can_enqueue:
needs: [pr-check]
name: Can try to merge
if: always() && github.event_name != 'merge_group' && github.event_name != 'push'
permissions:
actions: read
runs-on: ubuntu-latest
steps:
- env:
NEEDS_JSON: "${{toJSON(needs)}}"
name: Transform outcomes
run: |
echo "ALL_SUCCESS=$(echo "$NEEDS_JSON" | jq '. | to_entries | map([.value.result == "success", .value.result == "skipped"] | any) | all')" >> $GITHUB_ENV
- name: check outcomes
run: "[ $ALL_SUCCESS == true ]"
can_merge:
needs: [pr-check, merge-check]
name: Can merge
if: always() && github.event_name == 'merge_group'
permissions:
contents: read
pages: write
actions: read
id-token: write
runs-on: ubuntu-latest
steps:
- env:
NEEDS_JSON: "${{toJSON(needs)}}"
name: Transform outcomes
run: |
echo "ALL_SUCCESS=$(echo "$NEEDS_JSON" | jq '. | to_entries | map([.value.result == "success", .value.result == "skipped"] | any) | all')" >> $GITHUB_ENV
- name: check outcomes
run: "[ $ALL_SUCCESS == true ]"