From a4d6c783cac94b0777d8f483c0c19f36b31c5d12 Mon Sep 17 00:00:00 2001 From: "Jonas Merkle [JJM]" Date: Wed, 3 Jan 2024 15:13:38 +0100 Subject: [PATCH] update ci stuff & documentation --- .github/workflows/codeql.yml | 26 +++++++++++++++----------- .github/workflows/dotnet.yml | 31 +++++++++++++++++-------------- .gitignore | 11 +++++++++-- Doxyfile | 2 +- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 064c314..ff8906c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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: @@ -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. @@ -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 @@ -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}}" diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1dec4dd..e49363e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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" @@ -133,4 +137,3 @@ jobs: folder: doc/html config_file: Doxyfile target_folder: ${{ github.ref_name }}/doc/html - \ No newline at end of file diff --git a/.gitignore b/.gitignore index b1b1585..523611d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Doxyfile b/Doxyfile index a24fe35..6589093 100644 --- a/Doxyfile +++ b/Doxyfile @@ -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