Skip to content

Commit

Permalink
refactor(ci/codeql): Inline build steps
Browse files Browse the repository at this point in the history
The commit message reflects the changes made to the `.github/workflows/codeql.yml` file. The build step has been removed and its contents have been moved inline with the analyze job. Additionally, a new step has been added to restore dependencies before initializing CodeQL.
  • Loading branch information
SakuraIsayeki committed Mar 25, 2024
1 parent 0cc7e14 commit ce7e44f
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@ on:
workflow_dispatch:

jobs:
build:
uses: Nodsoft/workflows/.github/workflows/build-dotnet.yml@main
with:
dotnet-version: 8.0
project-file: "Nodsoft.MoltenObsidian.sln"
configuration: "Release"
artifact-name: "build-artifact"
use-nbgv: true

analyze:
name: Analyze
needs: build
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
Expand Down Expand Up @@ -55,6 +45,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- uses: dotnet/nbgv@v0.4
id: nbgv

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -68,9 +66,6 @@ jobs:

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- uses: dotnet/nbgv@v0.4
id: nbgv

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
Expand All @@ -87,11 +82,11 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Import build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: build-artifact
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down

0 comments on commit ce7e44f

Please sign in to comment.