-
Notifications
You must be signed in to change notification settings - Fork 9
96 lines (89 loc) · 2.95 KB
/
main.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
name: Main
on:
# We want to trigger these jobs in every branch.
push:
# But do not trigger them when only `md` files were modified.
paths-ignore:
- '**.md'
# `FORCE_COLOR` is used by `chalk`, which is used internally by `mocha`.
# https://github.com/chalk/chalk#supportscolor
# https://github.com/orgs/community/discussions/26944#discussioncomment-3254075
env:
FORCE_COLOR: 3
jobs:
check-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=`node --version`" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn compile
- run: yarn make:help
- run: git --no-pager diff --exit-code README.md
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=`node --version`" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn compile
- run: yarn lint
- run: yarn bundle
test:
strategy:
# Runs all node versions using the same `os` in parallel
max-parallel: 2
matrix:
os: [ubuntu-latest, windows-latest]
# https://nodejs.dev/en/about/releases/
node: [18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn test
# - run: yarn test:smoke
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=`node --version`" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn coverage
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=`node --version`" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn compile
- run: node examples/Compound.mjs
- run: node examples/USDC.mjs