-
Notifications
You must be signed in to change notification settings - Fork 81
97 lines (93 loc) · 2.48 KB
/
ci.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
97
name: ci
on:
push:
branches: [main, "v*"]
tags: ["v*"]
pull_request:
branches: [main, "v*"]
workflow_dispatch:
permissions:
contents: read
env:
# https://consoledonottrack.com/
DO_NOT_TRACK: 1
jobs:
tasks:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
task:
- format
- license-header
- lint
- attw
- bundle-size
- build
include:
- task: format
diff-check: true
- task: license-header
diff-check: true
- task: bundle-size
diff-check: true
name: ${{ matrix.task }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "npm"
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}/${{ matrix.task }}/${{ github.sha }}
restore-keys: ${{ runner.os }}/${{ matrix.task }}
- run: npm ci
- run: npx turbo run ${{ matrix.task }}
- name: Check changed files
if: ${{ matrix.diff-check }}
run: node scripts/gh-diffcheck.js
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Node.js v16 does not provide all necessary fetch types by default, so
# we cannot run tests for @connectrpc/connect-web.
# v16 is tested in a separate job below.
node-version: [22.7.0, 20.17.0, 18.20.4]
name: "test on Node.js ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "npm"
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}/test/${{ github.sha }}
restore-keys: ${{ runner.os }}/test
- run: npm ci
- run: npx turbo run test
test16:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: [16.20.2]
name: "test on Node.js ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "npm"
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}/test/${{ github.sha }}
restore-keys: ${{ runner.os }}/test
- run: npm ci
- run: npx turbo run test --filter '!@connectrpc/connect-web'