This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
chore(deps): Bump the tools group across 1 directory with 2 updates #530
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
types: [ opened, synchronize, reopened ] | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.operating-system }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup .NET SDK 6 on ${{ matrix.operating-system }} | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
with: | |
dotnet-version: 8.0.x | |
cache: true | |
cache-dependency-path: '**/packages.lock.json' | |
- name: Restore dependencies | |
run: dotnet restore --locked-mode | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
security: | |
name: Security Scan | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: ${{ !contains(github.event.head_commit.author.email, 'dependabot') || github.event_name != 'pull_request' }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
with: | |
dotnet-version: 8.0.x | |
cache: true | |
cache-dependency-path: '**/packages.lock.json' | |
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Sonarqube Begin | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
dotnet tool install --global dotnet-sonarscanner | |
dotnet-sonarscanner begin \ | |
/k:"sunt-programator_off.net" \ | |
/o:"sunt-programator" \ | |
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ | |
/d:sonar.host.url="https://sonarcloud.io" \ | |
/d:sonar.cs.vstest.reportsPaths="**/*.trx" \ | |
/d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal --logger:trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
- name: Sonarqube End | |
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |