generated from tksst/typescript-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (128 loc) · 3.76 KB
/
build-lint-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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build, Lint and Test
on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches-ignore:
- main
jobs:
check-skippable:
continue-on-error: true
runs-on: ubuntu-22.04
permissions:
actions: write
contents: read
timeout-minutes: 10
outputs:
skippable: ${{ steps.check.outputs.should_skip }}
steps:
- id: check
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
test:
name: Test
needs: check-skippable
if: needs.check-skippable.outputs.skippable != 'true'
permissions:
contents: read
actions: read
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
node-version:
- 16.14.0
- 18
- 20
- 22
experimental:
- false
include:
- os: windows-latest
# latest LTS
node-version: 20
experimental: false
- os: macos-latest
# latest LTS
node-version: 20
experimental: false
- os: ubuntu-22.04
node-version: 23-nightly
experimental: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@94c3c3d9567a0205de6da68a76c428ce4e769af1 # v2.0.0
with:
# Set to true to publish the results as comment to the PR (applicable if workflow run is triggered by PR).
comment_on_pr: false
- name: Checkout the source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
submodules: recursive
- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
standalone: true
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm test
build-lint:
name: Build and Lint
needs: check-skippable
if: needs.check-skippable.outputs.skippable != 'true'
permissions:
contents: read
actions: read
timeout-minutes: 10
# Using matrix strategy, OS and Node version will be displayed in a title of a job.
strategy:
matrix:
os:
- ubuntu-22.04
node-version:
# oldest LTS
- 18
runs-on: ${{ matrix.os }}
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@94c3c3d9567a0205de6da68a76c428ce4e769af1 # v2.0.0
- name: Checkout the source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
submodules: recursive
- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
standalone: false
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm lint
action-timeline:
needs:
- check-skippable
- test
- build-lint
continue-on-error: true
runs-on: ubuntu-22.04
permissions:
actions: read
timeout-minutes: 10
steps:
- uses: Kesin11/actions-timeline@3046833d9aacfd7745c5264b7f3af851c3e2a619 # v2.2.1