Skip to content

Commit

Permalink
pipeline changes
Browse files Browse the repository at this point in the history
Signed-off-by: Charity Kathure <[email protected]>
  • Loading branch information
Charity Kathure committed Nov 7, 2024
1 parent 84587d8 commit 1aaea68
Showing 1 changed file with 41 additions and 19 deletions.
60 changes: 41 additions & 19 deletions .github/workflows/sdl-compliance-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,40 @@ jobs:
BuildConfiguration: Release
SolutionPath: 'LogMonitor\LogMonitor.sln'
CodeQLResultsDir: "../codeql-results"
VCPKG_ROOT: $(System.DefaultWorkingDirectory)/vcpkg # Set the path for vcpkg root

steps:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Install Boost Library with vcpkg
# Step 2: Install vcpkg
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install boost-json:x64-windows
env:
VCPKG_DEFAULT_TRIPLET: "x64-windows"
echo "Installing vcpkg"
git clone https://github.com/microsoft/vcpkg.git $(VCPKG_ROOT)
cd $(VCPKG_ROOT)
.\bootstrap-vcpkg.bat
# https://github.com/marketplace/actions/setup-msbuild#specifying-msbuild-architecture-optional
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.build-platform }} # Default is x86. Options are x86, x64, and arm64

# Step 3: Install Boost JSON using vcpkg
- name: Install Boost JSON
run: |
echo "Installing Boost JSON"
$(VCPKG_ROOT)\vcpkg.exe install boost-json
# Step 4: Set up CMake and configure with vcpkg toolchain
- name: Configure CMake
run: |
echo "Configuring CMake"
cmake -B build -S . `
-DCMAKE_TOOLCHAIN_FILE=$(VCPKG_ROOT)\scripts\buildsystems\vcpkg.cmake `
-DCMAKE_CXX_STANDARD=17 `
-DCMAKE_BUILD_TYPE=Release
# Validate solution path exists
- name: Check solution path
run: |
if (-not (Test-Path -Path "${{ env.SolutionPath }}" -ErrorAction Continue)) {
Expand All @@ -68,19 +79,30 @@ jobs:
Write-Host "Solution path: ${{ env.SolutionPath }}"
Get-ChildItem "${{ env.SolutionPath }}" -ErrorAction Continue
# https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/
# https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning
# https://github.com/github/codeql-action/blob/main/init/action.yml
# Step 5: Build solution using MSBuild
- name: Build Solution with MSBuild
run: |
echo "Building solution"
msbuild $(Build.SourcesDirectory)\LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x64
# Step 6: Publish build artifacts (optional)
- name: Publish Build Artifacts
uses: actions/upload-artifact@v3
with:
name: drop
path: $(Build.SourcesDirectory)/LogMonitor/x64/Release

# Initialize CodeQL with specified configurations
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality # Default is "security-extended"
build-mode: ${{ matrix.build-mode }}

# https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#arguments
# Build LogMonitor project using MSBuild
- name: Build LogMonitor
run: |
run: |
msbuild.exe "${{ env.SolutionPath }}" /t:clean
msbuild.exe "${{ env.SolutionPath }}" /p:platform="${{ matrix.build-platform }}" /p:configuration="${{ env.BuildConfiguration }}"
Expand All @@ -92,4 +114,4 @@ jobs:
with:
# The path of the directory in which to save the SARIF results (../results/cpp.sarif)
output: ${{ env.CodeQLResultsDir }}
upload: "always" # Options: 'always', 'failure-only', 'never'
upload: "always" # Options: 'always', 'failure-only', 'never'

0 comments on commit 1aaea68

Please sign in to comment.