-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (105 loc) · 3.26 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: ci
on:
push:
branches: [master]
paths-ignore: ['**.md']
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- uses: actions/upload-artifact@v3
with:
name: build
path: packages/*/dist/**
test:
needs: build
strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16, 18, 20]
platform: [ubuntu, windows, macos]
name: test (node v${{ matrix.node-version }} ${{ matrix.platform }})
runs-on: ${{ matrix.platform }}-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build
path: packages
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install --global pnpm@6
if: ${{ matrix.node-version == 12 }}
- run: npm install --global pnpm@7
if: ${{ matrix.node-version == 14 }}
- run: npm install --global pnpm@8
if: ${{ matrix.node-version == 16 }}
- run: npm install --global pnpm
if: ${{ matrix.node-version >= 18 }}
# Old versions of pnpm don't support lockfile format v6 (pnpm v8+)
- run: pnpm install --frozen-lockfile --fix-lockfile
if: ${{ matrix.node-version <= 14 }}
- run: pnpm install --frozen-lockfile
if: ${{ matrix.node-version >= 16 }}
- run: pnpm run test
- run: pnpm run test:raw
- name: Report coverage
if: ${{ matrix.node-version == 20 && matrix.platform == 'ubuntu' && github.repository_owner == 'maxmilton' }}
run: |
curl -Lo ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
test-bun:
needs: build
strategy:
fail-fast: false
matrix:
# TODO: If bun ever gets native windows support, add it
platform: [ubuntu, macos]
name: test-bun (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build
path: packages
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun add -g pnpm
- run: pnpm install --frozen-lockfile
- run: bun run test
- run: bun run test:raw
lint:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build
path: packages
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint