Repository navigation
63 lines (52 loc) · 1.79 KB
/
Copy pathtest.yml
File metadata and controls
63 lines (52 loc) · 1.79 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
name: Tests
on:
push:
workflow_dispatch:
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
# The hardhat config decrypts an optional secrets env on load and prompts
# for a password when it is absent; a runner has no terminal to answer.
__decryptionAlreadyDone__: "TRUE"
NODE_OPTIONS: --max-old-space-size=4096
jobs:
test:
name: ${{ matrix.suite }}
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- suite: liquity
command: yarn hardhat test --no-compile
- suite: perimeter
command: yarn hardhat test --no-compile tests-perimeter/*.test.js
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Cache Solidity compilers
uses: actions/cache@v4
with:
path: ~/.cache/hardhat-nodejs
key: hardhat-compilers-${{ runner.os }}-${{ hashFiles('hardhat.config.ts') }}
restore-keys: hardhat-compilers-${{ runner.os }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Restore compiler execute bits
# A cache restore can drop the execute bit on the downloaded solc
# binaries; hardhat then fails to spawn them.
run: |
if [ -d "$HOME/.cache/hardhat-nodejs" ]; then
find "$HOME/.cache/hardhat-nodejs" -type f -name 'solc-*' -exec chmod +x {} +
fi
- name: Compile
# Hardhat 2.17 can expose a fresh compiler before chmod completes when
# compilation jobs download concurrently. Serialize cold-cache builds.
run: yarn hardhat compile --concurrency 1
- name: Test
run: ${{ matrix.command }}