-
Notifications
You must be signed in to change notification settings - Fork 1
193 lines (148 loc) · 4.2 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
push:
branches:
- renovate/*
- main
pull_request:
branches:
- main
workflow_call:
inputs:
version:
description: The version to set in the package.json files
default: "0.0.0"
required: false
type: string
branch_name:
description: The name of the branch
required: true
type: string
env:
NODE_VERSION: 22
defaults:
run:
shell: pwsh
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Run ESLint
run: pnpm run lint
- name: Run Prettier
run: pnpm prettier --check .
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Build
run: pnpm nx run-many --target build
- name: Log Version
run: Write-Host ${{ inputs.version }}
- name: Set Version
if: inputs.version != ''
run: pnpm nx run-many --target version --args="--version=${{ inputs.version }}"
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: build
path: ./dist
retention-days: 1
include-hidden-files: true
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Run Unit Tests
run: pnpm nx run-many --target test --configuration ci
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
local-licenses:
name: Check Licenses using Build
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Check licenses
run: node ./dist/packages/license-cop/src/bin/license-cop
published-licenses:
name: Check Licenses using the Published Version
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Check licenses
run: pnpm dlx license-cop
e2e:
name: E2E Test License-Cop
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Install Package Managers
run: corepack enable
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Run E2E Tests
run: pnpm nx run license-cop-e2e:e2e:ci
e2e-website:
name: E2E Test Website
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Install Cypress
run: pnpm cypress install
- name: Run E2E Tests
run: pnpm start-server-and-test 'pnpm nx run website:serve' http://localhost:4321 'pnpm nx run website-e2e:e2e:ci'