-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (73 loc) · 2.31 KB
/
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
name: CI
on:
pull_request:
branches: ['master']
push:
branches: ['master']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
name: 'Install'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check cache for "node_modules"
id: cache
uses: martijnhols/actions-cache/check@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Save "node_modules" to cache
if: steps.cache.outputs.cache-hit != 'true'
uses: martijnhols/actions-cache/save@v3
with:
path: '**/node_modules'
key: ${{ steps.cache.outputs.primary-key }}
check-formatting:
name: 'Check Formatting'
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-cache
- name: Check formatting with Prettier
run: yarn prettier:check
integration-test:
name: 'Integration tests'
runs-on: ubuntu-latest
environment: CI
needs: install
env:
INFURA_KEY: '${{ secrets.INFURA_KEY }}'
MAINNET_RPC: 'https://mainnet.infura.io/v3/${{ secrets.INFURA_KEY }}'
GOERLI_RPC: 'https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}'
SEPOLIA_RPC: 'https://sepolia.infura.io/v3/${{ secrets.INFURA_KEY }}'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-cache
- name: Test
run: yarn test:integration
unit-test:
name: 'Unit tests'
runs-on: ubuntu-latest
environment: CI
needs: install
env:
INFURA_KEY: '${{ secrets.INFURA_KEY }}'
MAINNET_RPC: 'https://mainnet.infura.io/v3/${{ secrets.INFURA_KEY }}'
GOERLI_RPC: 'https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}'
SEPOLIA_RPC: 'https://sepolia.infura.io/v3/${{ secrets.INFURA_KEY }}'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-cache
- name: Test
run: yarn test:unit
generate-token-lists:
uses: ./.github/workflows/generate-token-lists.yml
with:
environment: 'Test'
secrets: inherit