-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
98 lines (98 loc) · 3.08 KB
/
Copy pathtest.yml
File metadata and controls
98 lines (98 loc) · 3.08 KB
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
name: "Test"
on:
push:
branches:
- master
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]
env:
MIN_NODE_VERSION: &min_node_version "12"
NPM_CONFIG_AUDIT: "false"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "lts/*"
- name: "Install dependencies"
run: npm install
- name: "Lint sources"
run: npm run lint:sources -- --max-warnings 0
- name: "Lint types"
run: npm run lint:types
test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [*min_node_version, "lts/*"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node_version }}
- name: "Use npm 8 on Node 12"
if: ${{ matrix.node_version == '12' }}
run: npm install -g npm@8
- name: "Install dependencies"
run: npm install
- name: "Test sources"
run: npm run test:sources
- name: "Test types"
run: npm run test:types
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "lts/*"
- name: "Install protoc"
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: "Install dependencies"
run: npm install
- name: "Install benchmark dependencies"
run: npm --prefix bench install
- name: "Generate benchmark fixtures"
run: npm --prefix bench run generate
- name: "Run benchmark"
run: |
set -o pipefail
npm run bench 2>&1 | tee "$RUNNER_TEMP/bench.log"
{
echo '```'
sed -r 's/\x1b\[[0-9;]*m//g' "$RUNNER_TEMP/bench.log"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
conformance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "lts/*"
- name: "Install dependencies"
run: npm install --ignore-scripts
- name: "Install CLI dependencies"
run: npm --prefix cli install --ignore-scripts
- uses: ./.github/actions/conformance
- uses: actions/upload-artifact@v7
if: always()
with:
name: conformance-results
path: |
tests/conformance/out/conformance-tests.log
tests/conformance/out/static/conformance.json
tests/conformance/out/static/conformance.log
tests/conformance/out/static/failing_tests.txt
tests/conformance/out/static-plugin/conformance.json
tests/conformance/out/static-plugin/conformance.log
tests/conformance/out/static-plugin/failing_tests.txt
tests/conformance/out/reflect/conformance.json
tests/conformance/out/reflect/conformance.log
tests/conformance/out/reflect/failing_tests.txt
tests/conformance/out/reflect-plugin/conformance.json
tests/conformance/out/reflect-plugin/conformance.log
tests/conformance/out/reflect-plugin/failing_tests.txt
if-no-files-found: ignore