Skip to content

Commit 63b3159

Browse files
vicperdanaCopilot
andcommitted
fix: restore missing CI status checks from deleted workflows
- Add cross-platform test matrix to ci.yml matching old build.yaml: linux-x64, linux-musl-x64, win-x64 (pwsh + powershell), osx-x64 - Rename codeql.yml workflow to 'Analyze' and add: - PSRule analysis (Analyze with PSRule) from old analyze.yaml - DevSkim security scanning (Analyze with DevSkim) from old analyze.yaml - C# CodeQL analysis (Analyze with CodeQL) from old analyze.yaml - Keep existing JS/TS CodeQL for VS Code extension - Add pipeline-deps.ps1 and PSRule results upload to build job - Match old check names for branch protection rule compatibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4bba770 commit 63b3159

2 files changed

Lines changed: 162 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 86 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ jobs:
8585
with:
8686
dotnet-version: ${{ env.DOTNET_VERSION }}
8787

88+
- name: Install dependencies
89+
shell: pwsh
90+
timeout-minutes: 3
91+
run: ./scripts/pipeline-deps.ps1
92+
8893
- name: Download PSDocs Module
8994
uses: actions/download-artifact@v4
9095
with:
@@ -103,20 +108,94 @@ jobs:
103108
shell: pwsh
104109
working-directory: packages/psdocs-azure
105110
run: |
106-
Invoke-Build Build -File ./pipeline.build.ps1
107-
108-
- name: Test PSDocs.Azure
109-
shell: pwsh
110-
working-directory: packages/psdocs-azure
111-
run: |
112-
Invoke-Build Test -File ./pipeline.build.ps1
111+
Invoke-Build Build -File ./pipeline.build.ps1 -Configuration Release -AssertStyle GitHubActions
113112
114113
- name: Upload PSDocs.Azure Module
115114
uses: actions/upload-artifact@v4
116115
with:
117116
name: psdocs-azure-module
118117
path: packages/psdocs-azure/out/modules/PSDocs.Azure/
119118

119+
- name: Upload PSRule Results
120+
uses: actions/upload-artifact@v4
121+
if: always()
122+
with:
123+
name: Module.PSRule.TestResults
124+
path: packages/psdocs-azure/reports/ps-rule*.xml
125+
retention-days: 3
126+
if-no-files-found: ignore
127+
128+
test:
129+
name: Test (${{ matrix.rid }}-${{ matrix.shell }})
130+
needs: build-psdocs-azure
131+
if: needs.build-psdocs-azure.result == 'success'
132+
runs-on: ${{ matrix.os }}
133+
permissions:
134+
contents: read
135+
136+
strategy:
137+
fail-fast: false
138+
matrix:
139+
os: ['ubuntu-latest']
140+
rid: ['linux-x64']
141+
shell: ['pwsh']
142+
include:
143+
- os: windows-latest
144+
rid: win-x64
145+
shell: pwsh
146+
- os: windows-latest
147+
rid: win-x64
148+
shell: powershell
149+
- os: ubuntu-latest
150+
rid: linux-x64
151+
shell: pwsh
152+
- os: ubuntu-latest
153+
rid: linux-musl-x64
154+
shell: pwsh
155+
- os: macos-latest
156+
rid: osx-x64
157+
shell: pwsh
158+
159+
steps:
160+
- uses: actions/checkout@v4
161+
162+
- name: Setup .NET
163+
uses: actions/setup-dotnet@v4
164+
with:
165+
dotnet-version: ${{ env.DOTNET_VERSION }}
166+
167+
- if: ${{ matrix.shell == 'pwsh' }}
168+
name: Install dependencies (PowerShell)
169+
shell: pwsh
170+
timeout-minutes: 3
171+
run: ./scripts/pipeline-deps.ps1
172+
173+
- if: ${{ matrix.shell == 'powershell' }}
174+
name: Install dependencies (Windows PowerShell)
175+
shell: powershell
176+
timeout-minutes: 3
177+
run: ./scripts/pipeline-deps.ps1
178+
179+
- name: Download module
180+
uses: actions/download-artifact@v4
181+
with:
182+
name: psdocs-azure-module
183+
path: packages/psdocs-azure/out/modules/PSDocs.Azure
184+
185+
- if: ${{ matrix.shell == 'pwsh' }}
186+
name: Test module (PowerShell)
187+
shell: pwsh
188+
timeout-minutes: 15
189+
working-directory: packages/psdocs-azure
190+
run: Invoke-Build TestModule -File ./pipeline.build.ps1 -Configuration Release -AssertStyle GitHubActions
191+
192+
- if: ${{ matrix.shell == 'powershell' }}
193+
name: Test module (Windows PowerShell)
194+
shell: powershell
195+
timeout-minutes: 30
196+
working-directory: packages/psdocs-azure
197+
run: Invoke-Build TestModule -File ./pipeline.build.ps1 -Configuration Release -AssertStyle GitHubActions
198+
120199
build-vscode:
121200
needs: changes
122201
if: needs.changes.outputs.vscode == 'true' || github.event_name == 'push'

.github/workflows/codeql.yml

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,87 @@
1-
# CodeQL Security Analysis
2-
# Scans VS Code extension for security vulnerabilities
1+
# Security and Code Analysis
2+
# Scans for security vulnerabilities and code quality issues
33

4-
name: CodeQL
4+
name: Analyze
55

66
on:
77
push:
8-
branches: [main]
9-
paths:
10-
- 'packages/vscode-extension/**/*.ts'
11-
- 'packages/vscode-extension/**/*.js'
8+
branches: [main, 'release/*']
129
pull_request:
13-
branches: [main]
14-
paths:
15-
- 'packages/vscode-extension/**/*.ts'
16-
- 'packages/vscode-extension/**/*.js'
10+
branches: [main, 'release/*']
1711
schedule:
18-
# Run weekly on Monday at 00:00 UTC
19-
- cron: '0 0 * * 1'
12+
- cron: '26 21 * * 0' # At 09:26 PM, on Sunday each week
13+
workflow_dispatch:
14+
15+
permissions: {}
2016

2117
jobs:
22-
analyze:
23-
name: Analyze
18+
oss:
19+
name: Analyze with PSRule
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Run PSRule analysis
28+
uses: microsoft/ps-rule@v2.9.0
29+
with:
30+
modules: PSRule.Rules.MSFT.OSS
31+
prerelease: true
32+
33+
devskim:
34+
name: Analyze with DevSkim
35+
runs-on: ubuntu-latest
36+
permissions:
37+
actions: read
38+
contents: read
39+
security-events: write
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Run DevSkim scanner
45+
uses: microsoft/DevSkim-Action@v1.0.16
46+
with:
47+
directory-to-scan: packages/psdocs-azure/src/
48+
49+
- name: Upload results to security tab
50+
uses: github/codeql-action/upload-sarif@v3
51+
with:
52+
sarif_file: devskim-results.sarif
53+
54+
codeql-csharp:
55+
name: Analyze with CodeQL
56+
runs-on: ubuntu-latest
57+
permissions:
58+
actions: read
59+
contents: read
60+
security-events: write
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
65+
- name: Setup .NET
66+
uses: actions/setup-dotnet@v4
67+
with:
68+
dotnet-version: '8.0.x'
69+
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v3
72+
with:
73+
languages: 'csharp'
74+
75+
- name: Autobuild
76+
uses: github/codeql-action/autobuild@v3
77+
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@v3
80+
with:
81+
category: "/language:csharp"
82+
83+
codeql-typescript:
84+
name: CodeQL
2485
runs-on: ubuntu-latest
2586
permissions:
2687
actions: read
@@ -35,7 +96,6 @@ jobs:
3596
uses: github/codeql-action/init@v3
3697
with:
3798
languages: javascript-typescript
38-
# Focus on VS Code extension source
3999
paths:
40100
- packages/vscode-extension/src
41101

0 commit comments

Comments
 (0)