-
Notifications
You must be signed in to change notification settings - Fork 12
120 lines (100 loc) · 4.21 KB
/
package-contracts-test.yaml
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
name: Contracts - build, lint & test
on:
push:
branches:
- main
- development
paths:
- 'packages/contracts/**'
- '.github/workflows/package-contracts-test.yml'
- 'yarn.lock'
pull_request:
branches: [main, staging, development]
paths:
- 'packages/contracts/**'
- '.github/workflows/package-contracts-test.yml'
- 'yarn.lock'
env:
EXCLUDE_TESTS: "Abstract|BeefyERC4626Test|DotDotERC4626Test|ArrakisERC4626Test|JarvisERC4626Test|CurveERC4626Test|EllipsisERC4626Test|HelioERC4626Test|WombatERC4626Test|AaveV3ERC4626Test|ThenaERC4626Test|LeveredPositionLensTest|LeveredPositionFactoryTest|WmaticMaticXLeveredPositionTest|StkBnbWBnbLeveredPositionTest|Jbrl2BrlLeveredPositionTest|BombWbnbLeveredPositionTest|PearlUsdrWUsdrUsdrLpLeveredPositionTest|PearlUsdcUsdcUsdrLpLeveredPositionTest|PearlUsdrDaiUsdrLpLeveredPositionTest"
FLAKY_TESTS: "AnyLiquidationTest|LiquidityMiningTest"
SLOW_TESTS: "MaxBorrowTest|OraclesDecimalsScalingTest|MinBorrowTest|LeveredPositionTest|OraclesDecimalsScalingTest"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install NPM packages
run: yarn install
env:
# Fixes issue: `ethereumjs-abi: The remote archive doesn't match the expected checksum`
YARN_CHECKSUM_BEHAVIOR: update
- name: Lint
run: yarn workspace @ionicprotocol/contracts lint
build-and-test-mode:
needs: [lint]
env:
MNEMONIC: "${{ secrets.MNEMONIC }}"
TEST_RUN_CHAINID: 34443
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }}
MODE_MAINNET_RPC_URL: https://mainnet.mode.network/
MODE_ARCHIVE_RPC_URL: https://mainnet.mode.network/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Npm dependencies
run: yarn install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Forge dependencies
run: yarn workspace @ionicprotocol/contracts forge install
- name: Forge RPC cache
uses: actions/cache@v3
with:
path: "~/.foundry/cache"
key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }}-${{ github.sha }}
- name: Run base tests for Mode mainnet
run: yarn workspace @ionicprotocol/contracts forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}'
continue-on-error: true # Skip the job on test failure
- name: Run slow tests for Mode mainnet
if: always()
run: yarn workspace @ionicprotocol/contracts forge test -vv --match-contract '${{ env.SLOW_TESTS }}'
continue-on-error: true # Skip the job on test failure
- name: Run flaky tests for Mode mainnet
if: always()
run: yarn workspace @ionicprotocol/contracts forge test -vv --match-contract '${{ env.FLAKY_TESTS }}'
continue-on-error: true # Skip the job on test failure
build-and-test-local:
needs: [lint]
env:
MNEMONIC: "${{ secrets.MNEMONIC }}"
TEST_RUN_CHAINID: 0
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Npm dependencies
run: yarn install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Forge dependencies
run: yarn workspace @ionicprotocol/contracts forge install
- name: Forge RPC cache
uses: actions/cache@v3
with:
path: "~/.foundry/cache"
key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }}-${{ github.sha }}
- name: Run forge tests locally
run: yarn workspace @ionicprotocol/contracts forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}'
continue-on-error: true # Skip the job on test failure