-
Notifications
You must be signed in to change notification settings - Fork 414
135 lines (112 loc) · 3.01 KB
/
build-test-lint.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
134
135
name: Build, Lint & Test
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
# trigger on merge group as well (merge queue)
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TW_SECRET_KEY: ${{ secrets.TW_SECRET_KEY }}
jobs:
build:
timeout-minutes: 15
name: Build
runs-on: ubuntu-latest-16
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 25
- name: Install
uses: ./.github/composite-actions/install
- run: pnpm build
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
timeout-minutes: 5
id: cache-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
lint:
timeout-minutes: 15
name: Lint Packages
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: pnpm lint
test:
timeout-minutes: 15
name: Unit Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: pnpm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./packages/sdk/coverage/evm/lcov.info
e2e:
timeout-minutes: 15
name: E2E Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run e2e tests
run: pnpm e2e
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CLI_E2E_API_KEY: ${{ secrets.CLI_E2E_API_KEY }}