-
Notifications
You must be signed in to change notification settings - Fork 1.5k
133 lines (116 loc) · 3.91 KB
/
hardhat-core-ci.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
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
name: hardhat-core CI
# Note: this workflow uses `macos-13` to use x86
on:
push:
branches:
- main
paths:
- ".github/workflows/hardhat-core-ci.yml"
- "config/**"
- "packages/hardhat-core/**"
- "packages/hardhat-common/**"
pull_request:
paths:
- ".github/workflows/hardhat-core-ci.yml"
- "config/**"
- "packages/hardhat-core/**"
- "packages/hardhat-common/**"
workflow_dispatch:
inputs:
test-all-solc-versions:
description: Test all solc versions
required: false
default: "false"
defaults:
run:
working-directory: packages/hardhat-core
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
test-core:
name: Test core (${{ matrix.os }}, Node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18.15]
os: ["macos-13", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline
- name: Cache stack trace artifacts
uses: actions/cache@v4
with:
path: |
packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts
key: hardhat-network-stack-traces-tests-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/*.sol') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/test.json') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/**/*.ts') }}-v4
- name: Build
run: pnpm build
- name: Run tests
env:
INFURA_URL: ${{ secrets.INFURA_URL }}
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
NODE_OPTIONS: --max-old-space-size=4096
HARDHAT_TESTS_ALL_SOLC_VERSIONS: ${{ github.event.inputs.test-all-solc-versions}}
run: pnpm test:except-provider
test-provider:
name: Test provider (${{ matrix.os }}, Node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18.15]
os: ["macos-13", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline
- name: Cache EDR RPC cache
uses: actions/cache@v4
with:
path: |
packages/hardhat-core/test/internal/hardhat-network/edr-cache
key: hardhat-network-edr-cache-v2
- name: Build
run: pnpm build
- name: Run tests
env:
INFURA_URL: ${{ secrets.INFURA_URL }}
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: pnpm test:provider
test_types_node:
name: Test different versions of @types/node
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Currently there is no @types/node for Node 22,
# include it when it is available.
node: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install @types/node
run: pnpm add --save-dev @types/node@${{ matrix.node }}
- name: Build
run: pnpm build
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: pnpm test:except-tracing