-
Notifications
You must be signed in to change notification settings - Fork 677
93 lines (88 loc) · 3.3 KB
/
ci-build.yml
File metadata and controls
93 lines (88 loc) · 3.3 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
name: Node.js
on:
push:
branches:
- main
pull_request:
jobs:
test:
timeout-minutes: 6
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
node-version:
- "18.x"
- "20.x"
- "22.x"
- "24.x"
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Configure git settings (Windows)
if: matrix.os == 'windows-latest'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
- name: Check versions
run: |
node --version
npm --version
- name: Install dependencies
run: npm install --verbose
- name: Build packages
run: |
# Build packages without internal dependencies
npm run build --workspace=@slack/cli-hooks
npm run build --workspace=@slack/cli-test
# Build base dependencies
npm run build --workspace=@slack/logger
npm run build --workspace=@slack/types
# Build packages requiring base dependencies
npm run build --workspace=@slack/web-api
npm run build --workspace=@slack/webhook
# Build packages that depend on the Web API
npm run build --workspace=@slack/oauth
npm run build --workspace=@slack/rtm-api
npm run build --workspace=@slack/socket-mode
- name: Lint
run: npm run lint
- name: Build docs
run: npm run docs
- name: Run tests (Node 18/20)
if: matrix.node-version != '22.x' && matrix.node-version != '24.x'
# Node 18 lacks --test-reporter; Node 20 has coverage bugs. Use simpler script.
run: npm run test:node18 --workspaces --if-present
- name: Run tests (Node 22+)
if: matrix.node-version == '22.x' || matrix.node-version == '24.x'
run: npm test
- name: Upload code coverage
if: matrix.node-version == '24.x' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
fail_ci_if_error: true
files: packages/*/lcov.info
flags: cli-hooks,cli-test,logger,oauth,socket-mode,web-api,webhook
report_type: coverage
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Upload test results
if: ${{ !cancelled() }}
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
fail_ci_if_error: true
files: packages/cli-hooks/test-results.xml,packages/cli-test/test-results.xml,packages/logger/test-results.xml,packages/oauth/test-results.xml,packages/socket-mode/test-results.xml,packages/web-api/test-results.xml,packages/webhook/test-results.xml
flags: ${{ matrix.node-version }},${{ matrix.os }}
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true