-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
109 lines (80 loc) · 2.55 KB
/
test-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
name: CI Tests
on:
push:
branches:
- main
paths:
- "src.ts/**"
- "lib.esm/**"
- "lib.commonjs/**"
jobs:
test-node:
#if: ${{ false }} # disable for now
name: Run Node.js Tests
runs-on: ubuntu-latest
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
strategy:
fail-fast: false
matrix:
node-version: [ 18.x, 20.x ]
test-type: [ esm, commonjs ]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build ESM and CommonJS (from TypeScript)
run: npm run build-all
- name: Run tests (${{ matrix.test-type }})
run: npm run test-${{ matrix.test-type }}
coverage:
#if: ${{ false }} # disable for now
name: Generate Coverage Report
runs-on: ubuntu-latest
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
continue-on-error: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build ESM (from TypeScript)
run: npm run build
- name: Run coverage tests
run: npm run test-coverage
- name: Store coverage summary artifact
uses: actions/upload-artifact@v2
with:
name: coverage-summary
path: ./output/summary.txt
- name: Tar coverage files
run: tar -cvf ./output/coverage.tar ./output/lcov-report/
- name: Store full coverage artifact
uses: actions/upload-artifact@v2
with:
name: coverage-complete
path: ./output/coverage.tar
- name: Upload coverage to to build.ethers.org
uses: ethers-io/sync-s3-action@main
with:
aws_access_key_id: ${{ secrets.BUILD_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.BUILD_AWS_SECRET_ACCESS_KEY}}
aws_s3_bucket: ethers.org
source_folder: 'output/'
destination_prefix: 'build/output/'
aws_cloudfront_id: ${{ secrets.BUILD_AWS_CLOUDFRONT_ID }}