forked from NibiruChain/nibiru
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (133 loc) · 5.14 KB
/
e2e-evm.yml
File metadata and controls
154 lines (133 loc) · 5.14 KB
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
name: EVM E2E tests
# Run on PRs
on:
pull_request:
# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
jobs:
e2e-evm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: "Check for EVM-related changes"
id: check_evm_changes
uses: dorny/paths-filter@v3
with:
filters: |
evm-changes:
- "app/**/*.go"
- "cmd/**/*.go"
- "eth/**/*.go"
- "gosdk/**/*.go"
- "x/**/*.go"
- "**/*.proto"
- "**go.mod"
- "**go.sum"
- "contrib/docker-compose/*"
- "**.ts"
- "**.js"
- "**.json"
- name: skip-tests
if: steps.check_evm_changes.outputs.evm-changes == 'false'
run: |
echo "job: e2e-evm was skipped since relevant files were not changed."
- name: Set up Go
if: steps.check_evm_changes.outputs.evm-changes == 'true'
uses: actions/setup-go@v6
with:
go-version: 1.24
# cache: "The action has a built-in functionality for caching and
# restoring go modules and build outputs. It uses [actions/cache@v4]."
# - Handles go module cache (go env GOMODCACHE).
# - Handles go build cache (go env GOCACHE).
cache: true
- name: "Install just"
if: steps.check_evm_changes.outputs.evm-changes == 'true'
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just
- name: "Build the nibid binary"
if: steps.check_evm_changes.outputs.evm-changes == 'true'
run: |
just install
- name: Setup NodeJS with npm caching
if: steps.check_evm_changes.outputs.evm-changes == 'true'
uses: actions/setup-node@v6
with:
node-version: "lts/jod"
cache-dependency-path: "evm-e2e/package-lock.json"
- name: "just install"
if: steps.check_evm_changes.outputs.evm-changes == 'true'
run: just install
working-directory: "evm-e2e"
- name: "Launch localnet"
if: steps.check_evm_changes.outputs.evm-changes == 'true'
run: |
just localnet --no-build &
sleep 10
- name: "Run tests (just test)"
if: steps.check_evm_changes.outputs.evm-changes == 'true'
run: |
just install
just test
working-directory: "evm-e2e"
env:
JSON_RPC_ENDPOINT: http://127.0.0.1:8545
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
sai-trading:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: "Check for changes"
id: check_changes
uses: dorny/paths-filter@v3
with:
filters: |
check_changes:
- "sai-trading/**/*.ts"
- "sai-trading/artifacts/*"
- "sai-trading/**/*.go"
- "sai-trading/go.mod"
- "sai-trading/go.sum"
- name: Set up Go
if: steps.check_changes.outputs.check_changes == 'true'
uses: actions/setup-go@v6
with:
go-version: 1.24
# cache: "The action has a built-in functionality for caching and
# restoring go modules and build outputs. It uses [actions/cache@v4]."
# - Handles go module cache (go env GOMODCACHE).
# - Handles go build cache (go env GOCACHE).
cache: true
- name: "Install just"
if: steps.check_changes.outputs.check_changes == 'true'
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just
- name: "Build the nibid binary"
if: steps.check_changes.outputs.check_changes == 'true'
run: |
just install
- if: steps.check_changes.outputs.check_changes == 'true'
# For running things and for package management "
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.22 # Values: latest, <sha>, 1.2.3, canary
# Outputs:
# - cache-hit : Whether the executable was read from cache. Ex. "true"
# - bun-version : The output from running `bun-version`. Ex. "1.0.0"
# - bun-revision : The output from running `bun-revision`.
- if: steps.check_changes.outputs.check_changes == 'true'
working-directory: "sai-trading"
run: |
bun install
- if: steps.check_changes.outputs.check_changes == 'true'
run: |
just localnet --no-build &
sleep 10
- if: steps.check_changes.outputs.check_changes == 'true'
working-directory: "sai-trading"
run: |
just test