Repository navigation
208 lines (205 loc) · 6.79 KB
/
Copy pathrelease.yml
File metadata and controls
208 lines (205 loc) · 6.79 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Lint, Test & Release
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
permissions:
contents: read
jobs:
commitlint:
name: Lint commits
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint commit
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Lint commits
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
codelint:
name: Lint code
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint code
run: npm run lint
buildlint:
name: Check built files
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Build files
run: npm run build
- name: Check built files
run: git diff-files --quiet -w
test:
name: Run tests
runs-on: ubuntu-22.04
needs:
- commitlint
- codelint
- buildlint
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Run tests
run: npm run test -- --forbid-only
coverage:
name: Test coverage
runs-on: ubuntu-22.04
needs:
- commitlint
- codelint
- buildlint
permissions:
contents: read
pull-requests: write # to be able to comment on released pull requests
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install deps
run: npm ci
- name: Test code
run: npm run test:coverage -- --forbid-only
- name: Report coverage
run: |
echo "# Code coverage" >> $GITHUB_STEP_SUMMARY
npx nyc report | sed --expression='1d;$d' >> $GITHUB_STEP_SUMMARY
if: ${{ !cancelled() }}
runaction:
needs:
- commitlint
- codelint
- buildlint
- test
strategy:
# let every job finish so a failure on one runner doesn't hide the outcome (and hardware) of the others
fail-fast: false
matrix:
os: [ 'windows-2022', 'windows-2025' ]
sqlserver: [ 'sql-latest', 'sql-2025', 'sql-2022', 'sql-2019', 'sql-2017', 'sql-2016' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
# SQL Server can't start on a volume reporting a sector size over 4 KB, so record the runner's hardware to
# compare against any setup failures
- name: Log runner hardware
continue-on-error: true
shell: pwsh
# write everything straight to the host so it isn't reordered around the output of fsutil
run: |
try {
$vmSize = Invoke-RestMethod -Headers @{ Metadata = 'true' } -TimeoutSec 5 -Uri 'http://169.254.169.254/metadata/instance/compute/vmSize?api-version=2021-02-01&format=text'
} catch {
$vmSize = "unknown ($_)"
}
Write-Host "VM size: $vmSize"
Write-Host "CPU: $((Get-CimInstance Win32_Processor).Name)"
Get-PhysicalDisk | Format-Table -AutoSize FriendlyName, BusType, MediaType, LogicalSectorSize, PhysicalSectorSize | Out-Host
$forced = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device' -ErrorAction SilentlyContinue).ForcedPhysicalSectorSizeInBytes
Write-Host "ForcedPhysicalSectorSizeInBytes: $(if ($forced) { $forced } else { 'not set' })"
foreach ($volume in Get-Volume | Where-Object { $_.DriveLetter -and $_.DriveType -eq 'Fixed' } | Sort-Object DriveLetter) {
Write-Host "$($volume.DriveLetter):"
fsutil fsinfo sectorinfo "$($volume.DriveLetter):"
}
- name: Install sql server
uses: ./
with:
sqlserver-version: ${{ matrix.sqlserver }}
native-client-version: 11
odbc-version: 17
install-updates: true
- name: Upload SQL Server logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: sqlserver-logs-${{ matrix.os }}-${{ matrix.sqlserver }}-${{ github.run_attempt }}
path: |
C:/Program Files/Microsoft SQL Server/*/Setup Bootstrap/Log/
C:/Program Files/Microsoft SQL Server/MSSQL*/MSSQL/Log/
if-no-files-found: ignore
release:
name: Release
concurrency: release
if: ${{ github.repository_owner == 'tediousjs' && github.event_name == 'push' && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-22.04
needs:
- commitlint
- codelint
- buildlint
- test
- runaction
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release