-
Notifications
You must be signed in to change notification settings - Fork 1.2k
66 lines (57 loc) · 1.74 KB
/
ci-test.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
name: CI
on:
push:
branches:
- main
- next
pull_request:
jobs:
test:
name: 'Test with Node v${{ matrix.node-version }}'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [
# The minimum required node version for consumers
'20.10.0',
# Ensure it's working for the latest versions of node too
'latest',
]
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Free up space on GitHub image
run: |
# Based on the official advice:
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node with v${{ matrix.node-version }}
uses: actions/setup-node@v4
id: setup_node
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Restore cache
uses: actions/cache@v3
with:
path: |
**/.eslintcache
**/.turbo
node_modules/.cache/turbo
polaris.shopify.com/.next/cache
key: ${{ runner.os }}-node${{ steps.setup_node.outputs.node-version }}-test-v4-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node${{ steps.setup_node.outputs.node-version }}-test-v4-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Test
run: pnpm test