Skip to content

Commit

Permalink
Consolidated PR validation workflows
Browse files Browse the repository at this point in the history
* Updated any obsolete actions used in the workflows
* Use Linux agents whereever possible
* Merged PR Analysis InferSharp into PR Validation workflow (still as a separate job because of conflicting OS requirements of integration tests and InterSharp)
  • Loading branch information
ckadluba committed Sep 13, 2024
1 parent 0b93fcb commit 6281a81
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 52 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pr-analysis-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:

jobs:
build-and-codeql:
runs-on: windows-latest
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -28,6 +28,7 @@ jobs:

- name: Run build
run: ./Build.ps1 -SkipTests
shell: pwsh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-analysis-devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@v1

- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: devskim-results.sarif
42 changes: 0 additions & 42 deletions .github/workflows/pr-analysis-infersharp.yml

This file was deleted.

35 changes: 30 additions & 5 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,46 @@ on:

jobs:
build-and-test:
runs-on: windows-latest
runs-on: windows-latest # SQL Server LocalDB used in tests requires Windows
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run build and tests
run: ./Build.ps1
shell: pwsh

- name: Upload binaries artifact for InferSharp workflow
uses: actions/upload-artifact@v3
- name: Upload binaries artifact for InferSharp job
uses: actions/upload-artifact@v4
with:
name: bin-net6
path: src\Serilog.Sinks.MSSqlServer\bin\Release\net6.0

- name: Upload testresults artifact with code coverage file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: testresults
path: test\Serilog.Sinks.MSSqlServer.Tests\TestResults

infersharp:
runs-on: ubuntu-latest # Container action used by Infer# requires Linux
needs: build-and-test
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Download binaries artifact
uses: actions/download-artifact@v4
with:
name: bin-net6
path: bin-net6

- name: Run Infer#
uses: microsoft/[email protected]
with:
binary-path: bin-net6

- name: Upload SARIF output to GitHub Security Center
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: infer-out/report.sarif
1 change: 0 additions & 1 deletion serilog-sinks-mssqlserver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
.github\workflows\pr-analysis-codeql.yml = .github\workflows\pr-analysis-codeql.yml
.github\workflows\pr-analysis-devskim.yml = .github\workflows\pr-analysis-devskim.yml
.github\workflows\pr-analysis-infersharp.yml = .github\workflows\pr-analysis-infersharp.yml
.github\workflows\pr-validation.yml = .github\workflows\pr-validation.yml
README.md = README.md
.github\workflows\release.yml = .github\workflows\release.yml
Expand Down

0 comments on commit 6281a81

Please sign in to comment.