Skip to content

Commit f891915

Browse files
authored
refactor(workflows): consolidate and clean up GitHub workflows (#144)
1 parent 3ac84fd commit f891915

8 files changed

Lines changed: 140 additions & 248 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/workflows/devskim.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/dotnet.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# This workflow will build a .NET project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
1+
# This workflow will build and test .NET projects
32

43
name: .NET
54

65
on:
76
push:
8-
branches: [ "main" ]
7+
branches: ["main"]
98
pull_request:
10-
branches: [ "main" ]
9+
branches: ["main"]
1110

1211
jobs:
1312
build-api-client:
@@ -18,14 +17,34 @@ jobs:
1817
working-directory: ./src/adguard-api-dotnet
1918

2019
steps:
21-
- uses: actions/checkout@v4
22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v4
24-
with:
25-
dotnet-version: 10.0.x
26-
- name: Restore dependencies
27-
run: dotnet restore AdGuard.ApiClient.slnx
28-
- name: Build
29-
run: dotnet build AdGuard.ApiClient.slnx --no-restore
30-
- name: Test
31-
run: dotnet test AdGuard.ApiClient.slnx --no-build --verbosity normal
20+
- uses: actions/checkout@v4
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: 10.0.x
25+
- name: Restore dependencies
26+
run: dotnet restore AdGuard.ApiClient.slnx
27+
- name: Build
28+
run: dotnet build AdGuard.ApiClient.slnx --no-restore
29+
- name: Test
30+
run: dotnet test AdGuard.ApiClient.slnx --no-build --verbosity normal
31+
32+
build-rules-compiler:
33+
name: Build Rules Compiler
34+
runs-on: ubuntu-latest
35+
defaults:
36+
run:
37+
working-directory: ./src/rules-compiler-dotnet
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Setup .NET
42+
uses: actions/setup-dotnet@v4
43+
with:
44+
dotnet-version: 10.0.x
45+
- name: Restore dependencies
46+
run: dotnet restore RulesCompiler.slnx
47+
- name: Build
48+
run: dotnet build RulesCompiler.slnx --no-restore
49+
- name: Test
50+
run: dotnet test RulesCompiler.slnx --no-build --verbosity normal

.github/workflows/powershell.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/security.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Consolidated security scanning workflow
2+
# Combines CodeQL, DevSkim, and PSScriptAnalyzer
3+
4+
name: Security
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
schedule:
12+
- cron: "28 16 * * 6" # Weekly on Saturday
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
codeql:
19+
name: CodeQL Analysis
20+
runs-on: ubuntu-latest
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
language: ["csharp", "javascript"]
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v3
37+
with:
38+
languages: ${{ matrix.language }}
39+
40+
- name: Autobuild
41+
uses: github/codeql-action/autobuild@v3
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v3
45+
with:
46+
category: "/language:${{matrix.language}}"
47+
48+
devskim:
49+
name: DevSkim Analysis
50+
runs-on: ubuntu-latest
51+
permissions:
52+
actions: read
53+
contents: read
54+
security-events: write
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
60+
- name: Run DevSkim scanner
61+
uses: microsoft/DevSkim-Action@v1
62+
63+
- name: Upload DevSkim scan results
64+
uses: github/codeql-action/upload-sarif@v3
65+
with:
66+
sarif_file: devskim-results.sarif
67+
68+
psscriptanalyzer:
69+
name: PSScriptAnalyzer
70+
runs-on: ubuntu-latest
71+
permissions:
72+
contents: read
73+
security-events: write
74+
actions: read
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- name: Run PSScriptAnalyzer
80+
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f
81+
with:
82+
path: .\
83+
recurse: true
84+
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
85+
output: results.sarif
86+
87+
- name: Upload SARIF results
88+
uses: github/codeql-action/upload-sarif@v3
89+
with:
90+
sarif_file: results.sarif

.github/workflows/static.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

CLAUDE.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,13 @@ RemoveComments, Compress, RemoveModifiers, Validate, ValidateAllowIp, Deduplicat
420420
## CI/CD Alignment
421421

422422
GitHub Actions workflows validate:
423-
- `.github/workflows/dotnet.yml` - Builds/tests .NET projects with .NET 8
424-
- `.github/workflows/typescript.yml` - Node 20, tsc --noEmit, eslint for rules-compiler-typescript
423+
- `.github/workflows/dotnet.yml` - Builds/tests .NET projects (API client and rules compiler) with .NET 10
424+
- `.github/workflows/typescript.yml` - Node 20, tsc --noEmit, eslint for rules-compiler-typescript and website
425425
- `.github/workflows/gatsby.yml` - Builds website and deploys to GitHub Pages
426-
- `.github/workflows/powershell.yml` - PSScriptAnalyzer on PowerShell scripts
427-
- `.github/workflows/codeql.yml` - CodeQL security scanning
428-
- `.github/workflows/devskim.yml` - DevSkim security analysis
429-
- `.github/workflows/claude.yml` - Claude AI integration
430-
- `.github/workflows/claude-code-review.yml` - Automated code review
426+
- `.github/workflows/security.yml` - Consolidated security scanning (CodeQL, DevSkim, PSScriptAnalyzer)
427+
- `.github/workflows/release.yml` - Builds and publishes release binaries (.NET, Rust, Python)
428+
- `.github/workflows/claude.yml` - Claude AI integration for @claude mentions
429+
- `.github/workflows/claude-code-review.yml` - Automated PR code review
431430

432431
## Prerequisites
433432

0 commit comments

Comments
 (0)