Skip to content

Commit

Permalink
Fix CodeQL workflow and reformat workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvaneenwyk committed Jun 1, 2024
1 parent 03d054c commit d5f0bd4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 55 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
on: [push, pull_request]

env:
SLN: LPRun.sln
SLN: LPRun.sln
SLN_CONFIG: Release
BIN_POSTFIX: .Bin
RETENTION_DAYS: 1
Expand All @@ -13,33 +13,31 @@ jobs:
runs-on: windows-latest

steps:
# Set up

# Set up
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.0.x

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: |
8.0.x
# Check out

# Check out
- name: Check out ${{env.SLN}}
uses: actions/[email protected]

- name: Check out ${{env.SLN}}
uses: actions/[email protected]
# LPRun

# LPRun
- name: Restore ${{env.SLN}}
run: dotnet restore ${{env.SLN}}

- name: Restore ${{env.SLN}}
run: dotnet restore ${{env.SLN}}
- name: Build ${{env.SLN}} ${{env.SLN_CONFIG}}
run: dotnet build ${{env.SLN}} --configuration ${{env.SLN_CONFIG}} --no-restore -p:GITHUB_ACTIONS=true

- name: Build ${{env.SLN}} ${{env.SLN_CONFIG}}
run: dotnet build ${{env.SLN}} --configuration ${{env.SLN_CONFIG}} --no-restore -p:GITHUB_ACTIONS=true
# Upload artifacts

# Upload artifacts

- name: Publish LPRun ${{env.SLN_CONFIG}}
uses: actions/[email protected]
with:
name: LPRun${{env.BIN_POSTFIX}}
path: bin/${{env.SLN_CONFIG}}/LPRun.*.*nupkg
retention-days: ${{env.RETENTION_DAYS}}
- name: Publish LPRun ${{env.SLN_CONFIG}}
uses: actions/[email protected]
with:
name: LPRun${{env.BIN_POSTFIX}}
path: bin/${{env.SLN_CONFIG}}/LPRun.*.*nupkg
retention-days: ${{env.RETENTION_DAYS}}
70 changes: 38 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
pull_request:
branches: [main, develop]
schedule:
- cron: '40 19 * * 0'
- cron: "40 19 * * 0"

env:
SLN: LPRun.sln
SLN_CONFIG: Release
BIN_POSTFIX: .Bin
RETENTION_DAYS: 1

jobs:
analyze:
name: Analyze (${{ matrix.language }})

runs-on: windows-latest
timeout-minutes: 120
permissions:
Expand All @@ -29,34 +33,36 @@ jobs:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: manual
- language: csharp
build-mode: manual

name: Analyze (${{ matrix.language }})

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.0.x

- if: matrix.build-mode == 'manual'
name: Restore ${{env.SLN}}
run: dotnet restore ${{env.SLN}}

- if: matrix.build-mode == 'manual'
name: Build ${{env.SLN}} ${{env.SLN_CONFIG}}
run: dotnet build ${{env.SLN}} --configuration ${{env.SLN_CONFIG}} --no-restore -p:GITHUB_ACTIONS=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.0.x

- if: matrix.build-mode == 'manual'
name: Restore ${{env.SLN}}
run: dotnet restore ${{env.SLN}}

- if: matrix.build-mode == 'manual'
name: Build ${{env.SLN}} ${{env.SLN_CONFIG}}
run: dotnet build ${{env.SLN}} --configuration ${{env.SLN_CONFIG}} --no-restore -p:GITHUB_ACTIONS=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit d5f0bd4

Please sign in to comment.