Feature/soft hard derivation #32
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: build | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: # All pull requests | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: build & test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
## | |
# Setup | |
# Setup multiple .NET versions so we can build against all referenced .NET versions. | |
## | |
- name: Setup .NET Core 2.1.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 2.1.x | |
- name: Setup .NET Core 3.1.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.x | |
- name: Setup .NET 6.0.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
## | |
# Dependencies | |
# Restore the project and its dependencies. | |
## | |
- name: Install dependencies | |
run: dotnet restore | |
- 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:"SubstrateGaming_Substrate.NET.Wallet" /o:"substrategaming" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | |
dotnet build | |
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
- name: Build test project | |
run: dotnet build .\Substrate.NET.Wallet.Test | |
- name: Test | |
run: dotnet test |