Update README.md #47
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: CI & CD | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonar: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '6.0.x' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Install sonarscanner | |
run: dotnet tool install --global dotnet-sonarscanner | |
- name: Build for Analysis | |
run: | | |
dotnet sonarscanner begin /k:"omerfarukz_autocomplete" /o:"omerfarukz" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="./**/coverage.opencover.xml" | |
dotnet build | |
dotnet test -p:coverletOutput=./coverage.opencover.xml -p:CollectCoverage=true -p:CoverletOutputFormat=opencover | |
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
- name: Build for Release | |
run: dotnet build --configuration Release --no-restore | |
- name: Publish the package to nuget | |
run: dotnet nuget push AutoComplete/bin/Release/*.nupkg --api-key "${{secrets.NUGET_SECRET}}" -s https://api.nuget.org/v3/index.json | |