-
Notifications
You must be signed in to change notification settings - Fork 2.2k
107 lines (90 loc) · 3.41 KB
/
protocol.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
name: Protocol
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "packages/protocol/**"
- "!packages/protocol/contract_layout_*"
- "!packages/protocol/audit/**"
- "!packages/protocol/docs/**"
- "!packages/protocol/simulation/**"
- "!packages/protocol/deployments/**"
- "!packages/protocol/script/layer2/hekla/**"
- "!packages/protocol/script/layer2/mainnet/**"
- "!packages/protocol/script/layer1/hekla/**"
- "!packages/protocol/script/layer1/mainnet/**"
- "!packages/protocol/script/layer1/preconf/**"
- "!packages/protocol/script/layer1/provers/**"
- "!packages/protocol/script/layer1/team/**"
branches-ignore:
- release-please--branches--**
jobs:
build-protocol:
if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }}
runs-on: [arc-runner-set]
permissions:
# Give the necessary permissions for stefanzweifel/git-auto-commit-action.
contents: write
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Prepare environment
continue-on-error: true
run: sudo apt-get update && sudo apt-get install -y git wget
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/[email protected]
- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies
- name: Clean up and fmt
working-directory: ./packages/protocol
run: pnpm clean && forge fmt
- name: L2-Unit tests
working-directory: ./packages/protocol
run: pnpm compile:l2 && pnpm test:l2 && pnpm layout:l2
- name: L1-Unit tests
working-directory: ./packages/protocol
run: pnpm compile:l1 && pnpm test:l1 && pnpm layout:l1
- name: Commit contract layout table
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "forge fmt & update contract layout tables"
- name: L1-Deploy contracts
working-directory: ./packages/protocol
timeout-minutes: 2
run: |
anvil --hardfork cancun &
until cast chain-id --rpc-url "http://localhost:8545" 2> /dev/null; do
sleep 1
done
pnpm test:deploy:l1
genesis-docker:
if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }}
runs-on: [taiko-runner]
permissions:
# Give the necessary permissions for stefanzweifel/git-auto-commit-action.
contents: write
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/[email protected]
- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies
- name: Compile
working-directory: ./packages/protocol
run: pnpm clean && pnpm compile
- name: L2-Generate Genesis (using docker)
working-directory: ./packages/protocol
run: pnpm genesis:test