Refactor integration test harness #1025
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| env: | |
| SLOW_MACHINE: 1 | |
| jobs: | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| id: setup-go | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Download Go modules | |
| shell: bash | |
| if: ${{ steps.setup-go.outputs.cache-hit != 'true' }} | |
| run: go mod download | |
| - name: Build | |
| run: make bins | |
| - name: Test | |
| run: make test | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| vector: [bitcoin_clncln, bitcoin_mixed, bitcoin_lndlnd, liquid_clncln, liquid_mixed, liquid_lndlnd, misc, lnd] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: cachix/install-nix-action@v31 | |
| - uses: cachix/cachix-action@v16 | |
| with: | |
| name: peerswap | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| useDaemon: true | |
| # Switch to nix-shell for integration tests instead of nix develop. | |
| # The 'nix develop' command can be unstable in some CI environments, | |
| # causing issues like "clightning-1: Lost connection to the RPC socket." | |
| # While the root cause is unclear, switching to nix-shell provides a more stable alternative for CI. | |
| # For more context, see the issue in this failed job: https://github.com/ElementsProject/peerswap/actions/runs/16064376179/job/45336040866?pr=385 | |
| - name: Build test binaries | |
| run: | | |
| nix-shell --run "make test-bins" | |
| - name: Run integration tests | |
| run: | | |
| nix-shell --run "RUN_INTEGRATION_TESTS=1 PAYMENT_RETRY_TIME=10 PEERSWAP_TEST_FILTER=$PEERSWAP_TEST_FILTER make test-matrix-${{ matrix.vector }}" |