Metadata + Events / Extrinsics / Blocks database integration #59
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Build & Analyse | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build and test | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '8.0.x' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Restore dependencies | |
run: dotnet restore Polkanalysis.sln | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- 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: 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 | |
shell: powershell | |
run: | | |
dotnet tool install --global dotnet-coverage | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Apolixit_Polkanalysis" /o:"apolixit" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml | |
dotnet build Polkanalysis.sln | |
dotnet-coverage collect "dotnet test Polkanalysis.sln" -f xml -o "coverage.xml" | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
- name: Test Solution | |
run: dotnet test Polkanalysis.sln --verbosity normal --logger "trx;LogFileName=test-results.trx" | |
- name: Publish Test Results | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Test results | |
path: "**/test-results.trx" | |
reporter: dotnet-trx | |
fail-on-error: true |