-
Notifications
You must be signed in to change notification settings - Fork 11
89 lines (79 loc) · 2.33 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
name: Check Pre Genesis Transactions 👨🔧
on:
merge_group:
pull_request:
branches:
- main
push:
branches:
- main
paths:
- transactions/*.toml
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
packages: write
contents: write
env:
CAN_ADD_VALIDATORS: ${{ vars.CAN_ADD_VALIDATORS }}
CAN_ADD_BONDS: ${{ vars.CAN_ADD_BONDS }}
CAN_ADD_ACCOUNTS: ${{ vars.CAN_ADD_ACCOUNTS }}
jobs:
pr-check:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
name: Shallow PR check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: python3 scripts/validate-pr.py
merge-check:
runs-on: ubuntu-latest
name: Deep merge check
if: ${{ github.event_name == 'merge_group' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: python3 scripts/merge-pr.py
main:
if: ${{ github.ref == 'refs/heads/main' }}
name: Rebuild graphs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: python3 scripts/rebuild.py
can_enqueue:
needs: [pr-check]
name: Can try to merge
if: always() && github.event_name != 'merge_group'
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 ]"