Move mining from docker to code #492
This file contains hidden or 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 and Test | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Initialize | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Clean project | |
| run: dotnet clean | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Deterministic build check | |
| run: | | |
| dotnet tool install --global dotnet-validate --version 0.0.1-preview.537 | |
| dotnet pack Monero/Monero.csproj -c Release /p:PackageVersion=1 --no-build -o nuget-packages | |
| dotnet validate package local nuget-packages/MoneroNet.1.0.0.nupkg | |
| - name: Run unit tests | |
| run: | | |
| dotnet tool install --global JetBrains.dotCover.CommandLineTools --version 2025.1.8 | |
| dotCover cover-dotnet \ | |
| --TargetArguments="test Monero.UnitTests/Monero.UnitTests.csproj -c Release --no-build" \ | |
| --output=coverage/dotCover.UnitTests.output.dcvr \ | |
| --filters="-:Assembly=Monero.UnitTests;-:Assembly=testhost;-:Assembly=xunit.v3.*" | |
| - name: Run integration tests | |
| run: docker compose -f Monero.IntegrationTests/docker-compose.yml run tests | |
| - name: Cleanup Docker containers | |
| if: always() | |
| run: docker compose -f Monero.IntegrationTests/docker-compose.yml down -v | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-report | |
| path: coverage/dotcover.xml | |
| - name: Upload NuGet package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nuget-package-${{ github.sha }} | |
| path: nuget-packages/MoneroNet.1.0.0.nupkg |