Skip to content

Commit

Permalink
update ci stuff & documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-merkle committed Jan 3, 2024
1 parent e69cf62 commit a4d6c78
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 28 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ name: "CodeQL"

on:
push:
branches: [ "main", "develop" ]
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '44 16 * * 2'
- cron: '00 4 * * 1'

jobs:
analyze:
name: Analyze
# 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
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
Expand All @@ -34,18 +38,18 @@ jobs:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -56,10 +60,10 @@ jobs:
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# 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)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -72,6 +76,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
31 changes: 17 additions & 14 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
name: Build and test in Debug configuration
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
version: [6.x, 7.x]
os: [ubuntu-latest]
version: [8.x, 6.x, netstandard2.0, netstandard2.1]
defaults:
run:
working-directory: ./src
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup dotNET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.version }}
- name: Restore dependencies
Expand All @@ -40,23 +40,27 @@ jobs:
build-and-test-release:
name: Build and test in Release configuration
needs: build-and-test-debug
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
version: [8.x]
defaults:
run:
working-directory: ./src
runs-on: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup dotNET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: ${{ matrix.version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test --no-build -c Release --verbosity normal

sonarcloud:
name: Build and analyze with SonarCloud
needs: build-and-test-release
Expand All @@ -67,7 +71,7 @@ jobs:
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
Expand All @@ -91,9 +95,9 @@ jobs:
key: ${{ runner.os }}-dotnet-coverage
restore-keys: ${{ runner.os }}-dotnet-coverage
- name: Setup dotNET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
Expand All @@ -113,7 +117,7 @@ jobs:
shell: powershell
run: |
cd .\src
.\..\.sonar\scanner\dotnet-sonarscanner begin /k:"jjm-one_jjm.one.Microsoft.Extensions.Logging.Helpers" /o:"jjm-one" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
.\..\.sonar\scanner\dotnet-sonarscanner begin /k:"jjm-one_jjm.one.Microsoft.Extensions.Logging.Helpers" /o:"jjm-one" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet restore
dotnet build --no-restore -c Debug
.\..\.dotnet-coverage\dotnet-coverage\dotnet-coverage collect "dotnet test --no-build --verbosity normal" -f xml -o "coverage.xml"
Expand All @@ -133,4 +137,3 @@ jobs:
folder: doc/html
config_file: Doxyfile
target_folder: ${{ github.ref_name }}/doc/html

11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Ignore localy generated doc files
doc
###########################
# Custom Ignore Settings: #
###########################

## Ignore Doxygen generated files
doc/html
doc/latex
doc/man


# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,visualstudio,jetbrains+all
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,visualstudio,jetbrains+all
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = jjm.one.Microsoft.Extensions.Logging.Helpers
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.2.1
PROJECT_NUMBER = 1.2.4

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down

0 comments on commit a4d6c78

Please sign in to comment.