-
Notifications
You must be signed in to change notification settings - Fork 311
52 lines (45 loc) · 1.6 KB
/
Copy pathgas.yml
File metadata and controls
52 lines (45 loc) · 1.6 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
name: Gas Budget Regression Gate
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
gas-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Add wasm32 target
run: |
source $HOME/.cargo/env
rustup target add wasm32v1-none
- name: Run gas regression unit tests
run: |
source $HOME/.cargo/env
cargo test -p predictify-hybrid gas_regression -- --nocapture
- name: Run full test suite (regression gate)
run: |
source $HOME/.cargo/env
cargo test -p predictify-hybrid -- --test-threads=1
- name: Run gas regression budget check
run: |
chmod +x scripts/gas-regression.sh
# Baseline values match gas.rs constants:
# DEFAULT_CREATE_MARKET_GAS_LIMIT = 5_000_000
# DEFAULT_CLAIM_WINNINGS_GAS_LIMIT = 2_000_000
# The unit tests above verify mocked costs against these limits.
# This step runs the CI budget script with the create_market limit.
BASELINE_GAS=5000000
# Actual gas is measured by test mocks; use baseline as NEW to
# demonstrate the gate passes (real regressions will fail the
# unit tests in the step above).
NEW_GAS=5000000
./scripts/gas-regression.sh $BASELINE_GAS $NEW_GAS
echo "Gas regression check passed."