feat: update versions #52
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: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
welcome: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Hello message | |
run: echo "Hello guys" | |
build: | |
runs-on: ubuntu-latest | |
needs: welcome | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Test | |
run: dotnet test | |
publish: | |
runs-on: ubuntu-latest | |
needs: [welcome, build, test, sonarcloud] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Publish | |
run: dotnet publish | |
sonarcloud: | |
runs-on: windows-latest | |
needs: welcome | |
steps: | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.11 | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # perf improvement | |
- name: Cache SonarCloud workspace | |
uses: actions/cache@v1 | |
with: | |
path: ~\.sonar\cache | |
key: ${{ runner.os }}-sonar-cache | |
restore-keys: ${{ runner.os }}-sonar-cache | |
- name: Cache SonarCloud scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@v1 | |
with: | |
path: .\.sonar\scanner | |
key: ${{ runner.os }}-sonar-scanner | |
restore-keys: ${{ runner.os }}-sonar-scanner | |
- 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: Analyze | |
shell: powershell | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /d:sonar.verbose=true /k:"kubmir_ActionsKata" /o:"kubmir" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | |
dotnet build Actions-Kata.sln | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |