Skip to content

Commit

Permalink
Refactoring workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
frasermolyneux committed Nov 9, 2023
1 parent 87438b5 commit 26d88c8
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 3 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Code Quality

on: push

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
actions: read # Required by CodeQL
security-events: write # Required by CodeQL

jobs:
code-scanning:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Install SonarCloud scanners
shell: bash
run: |
cd src
dotnet tool install --global dotnet-sonarscanner
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'csharp'

- name: Begin SonarScanner
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd src
dotnet-sonarscanner begin /k:"frasermolyneux_personal-finances" /o:"frasermolyneux" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
- uses: frasermolyneux/actions/dotnet-web-ci@main
with:
dotnet-project: "web-app"
dotnet-version: 7.0.x
src-folder: "src"

- uses: frasermolyneux/actions/dotnet-func-ci@main
with:
dotnet-project: "func-app"
dotnet-version: 7.0.x
src-folder: "src"

- name: End SonarScanner
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd src
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:'csharp'"
3 changes: 0 additions & 3 deletions .github/workflows/release-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ on:
- main

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
actions: read # Required by CodeQL
security-events: write # Required by CodeQL

concurrency: # This is required to prevent multiple runs of the same workflow from running at the same time.
group: ${{ github.workflow }}
Expand Down

0 comments on commit 26d88c8

Please # to comment.