Skip to content

updates dependabot settings #132

updates dependabot settings

updates dependabot settings #132

Workflow file for this run

name: dotNet
on:
push:
branches:
- main
- develop
- feature/ci
pull_request:
branches:
- main
- develop
- feature/ci
jobs:
build-and-test-debug:
name: Build and test in Debug configuration
strategy:
matrix:
os: [ubuntu-latest]
version: [8.x, 6.x]
defaults:
run:
working-directory: ./src
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup dotNET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Debug
- name: Test
run: dotnet test --no-build --verbosity normal
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: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup dotNET
uses: actions/setup-dotnet@v4
with:
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
runs-on: windows-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Cache dotnet-coverage
id: cache-dotnet-coverage
uses: actions/cache@v3
with:
path: .\.dotnet-coverage\dotnet-coverage
key: ${{ runner.os }}-dotnet-coverage
restore-keys: ${{ runner.os }}-dotnet-coverage
- name: Setup dotNET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Install dotnet-coverage
if: steps.cache-dotnet-coverage.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.dotnet-coverage\dotnet-coverage -ItemType Directory
dotnet tool update dotnet-coverage --tool-path .\.dotnet-coverage\dotnet-coverage
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
cd .\src
.\..\.sonar\scanner\dotnet-sonarscanner begin /k:"jjm-one_jjm.one.MiscUtilFunctions" /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"
cat coverage.xml
.\..\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
publish-doc:
name: Publish Documentation
needs: [build-and-test-debug]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: DenverCoder1/doxygen-github-pages-action@v1.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: doc/html
config_file: Doxyfile
target_folder: ${{ github.ref_name }}/doc/html