diff --git a/.github/workflows/tests-rc.yaml b/.github/workflows/tests-rc.yaml index 83c8ddc2..47cb462d 100644 --- a/.github/workflows/tests-rc.yaml +++ b/.github/workflows/tests-rc.yaml @@ -58,11 +58,11 @@ jobs: - name: Deposit to chequebook run: | - swarm-cli cheque deposit 100000000000000000 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633 + swarm-cli cheque deposit 10 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 - name: Print swarm-cli status continue-on-error: true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e752252a..24ca56ae 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -42,21 +42,48 @@ jobs: - name: Deposit to chequebook run: | - swarm-cli cheque deposit 100000000000000000 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633 + swarm-cli cheque deposit 10 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 - name: Print swarm-cli status continue-on-error: true run: swarm-cli status - name: Tests - run: npm run test + run: npm run test:coverage - - name: Compare coverage + - name: Upload coverage + if: github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v4 + with: + name: coverage-master + path: test/coverage/coverage-summary.json + + - name: Get master run ID + if: github.ref != 'refs/heads/master' + id: get-run-id + continue-on-error: true + env: + GH_TOKEN: ${{ github.token }} + run: | + RUN_ID=$(gh run list --branch master --workflow tests.yaml --limit 1 --json databaseId --jq '.[0].databaseId') + echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT + + - name: Download master coverage if: github.ref != 'refs/heads/master' - run: - npxie coverage-comparison "${{ github.repository }}" "master" "${{ github.head_ref }}" - "test/coverage/coverage-summary.json" "${{ github.event.pull_request.number }}" "${{ secrets.GITHUB_TOKEN }}" + id: download-coverage + continue-on-error: true + uses: actions/download-artifact@v4 + with: + name: coverage-master + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ steps.get-run-id.outputs.run-id }} + path: coverage-master + + - name: Compare coverage + if: github.ref != 'refs/heads/master' && steps.download-coverage.outcome == 'success' + run: | + npxie coverage-comparison "${{ github.repository }}" "./coverage-master/coverage-summary.json" "test/coverage/coverage-summary.json" "${{ github.event.pull_request.number }}" "${{ secrets.GITHUB_TOKEN }}"