|
| 1 | +name: BTCPay Plugin tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["master"] |
| 6 | + pull_request: |
| 7 | + branches: ["master"] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + env: |
| 20 | + CI: true |
| 21 | + DOTNET_NOLOGO: true |
| 22 | + DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 23 | + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages |
| 24 | + FLORESTA_REPO: https://github.com/getfloresta/Floresta.git#v0.9.1 |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + |
| 31 | + - name: Initialize and update submodules |
| 32 | + run: git submodule update --init --recursive |
| 33 | + |
| 34 | + - name: Setup .NET |
| 35 | + uses: actions/setup-dotnet@v4 |
| 36 | + with: |
| 37 | + dotnet-version: 10.0.x |
| 38 | + |
| 39 | + - name: Cache NuGet packages |
| 40 | + uses: actions/cache@v4 |
| 41 | + with: |
| 42 | + path: .nuget/packages |
| 43 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/nuget.config', '**/global.json') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-nuget- |
| 46 | +
|
| 47 | + - name: Set Docker test user |
| 48 | + run: | |
| 49 | + echo "DOTNET_TEST_UID=$(id -u)" >> "$GITHUB_ENV" |
| 50 | + echo "DOTNET_TEST_GID=$(id -g)" >> "$GITHUB_ENV" |
| 51 | +
|
| 52 | + - name: Build plugin and tests |
| 53 | + run: > |
| 54 | + dotnet build BTCPayServer.Plugins.Floresta.Tests/BTCPayServer.Plugins.Floresta.Tests.csproj |
| 55 | + -m:1 |
| 56 | + -p:UseSharedCompilation=false |
| 57 | + -p:RunAnalyzers=false |
| 58 | + -p:EnableNETAnalyzers=false |
| 59 | + -nr:false |
| 60 | +
|
| 61 | + - name: Run unit tests |
| 62 | + run: > |
| 63 | + dotnet test BTCPayServer.Plugins.Floresta.Tests/BTCPayServer.Plugins.Floresta.Tests.csproj |
| 64 | + --no-build |
| 65 | + --filter "Integration!=Integration&Playwright!=Playwright" |
| 66 | + --logger "console;verbosity=normal" |
| 67 | + -m:1 |
| 68 | + -p:UseSharedCompilation=false |
| 69 | + -p:RunAnalyzers=false |
| 70 | + -p:EnableNETAnalyzers=false |
| 71 | + -nr:false |
| 72 | +
|
| 73 | + - name: Run integration tests |
| 74 | + run: > |
| 75 | + docker compose -f docker-compose.integration.yml |
| 76 | + up --build --abort-on-container-exit --exit-code-from tests tests |
| 77 | +
|
| 78 | + - name: Cleanup integration stack |
| 79 | + if: always() |
| 80 | + run: docker compose -f docker-compose.integration.yml down --volumes --remove-orphans |
| 81 | + |
| 82 | + - name: Run Playwright E2E tests |
| 83 | + run: > |
| 84 | + docker compose -f docker-compose.integration.yml --profile e2e |
| 85 | + up --build --abort-on-container-exit --exit-code-from e2e-tests e2e-tests |
| 86 | +
|
| 87 | + - name: Cleanup Playwright E2E stack |
| 88 | + if: always() |
| 89 | + run: docker compose -f docker-compose.integration.yml --profile e2e down --volumes --remove-orphans |
0 commit comments