Revise spec to be in Typst + Add some agda #11994
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" | |
| # Limit concurrent runs of this workflow within a single PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| # We're using merge-chains; so this needs to run then. | |
| merge_group: | |
| push: | |
| branches: | |
| - master | |
| - release | |
| pull_request: | |
| # Allows to trigger runs on any branch | |
| workflow_dispatch: | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build-test: | |
| name: "Build & test" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| package: | |
| - hydra-plutus | |
| - hydra-tx | |
| - hydra-chain-observer | |
| - hydra-node | |
| - hydra-cluster | |
| - hydra-tui | |
| os: | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| exclude: | |
| - package: hydra-cluster | |
| os: ubuntu-24.04-arm | |
| - package: hydra-tui | |
| os: ubuntu-24.04-arm | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: β Setup Nix/Cachix | |
| uses: ./.github/actions/nix-cachix-setup | |
| with: | |
| authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}' | |
| - name: β Test | |
| if: ${{ matrix.package != 'hydra-tui' }} | |
| run: | | |
| cd ${{ matrix.package }} # To ensure the `./golden` files are available. | |
| mkdir -p test-reports | |
| # hydra-node's NetworkSpec spins etcd subprocesses; under tasty's | |
| # default parallelism it wedges on these small CI runners (etcd | |
| # loses quorum after the manual lease revoke and the suite hangs). | |
| # Force the suite single-threaded here; other packages keep tasty's | |
| # default parallelism, which they handle fine. | |
| threads_flag="" | |
| if [ "${{ matrix.package }}" = "hydra-node" ]; then | |
| threads_flag="--num-threads=1" | |
| fi | |
| nix develop .#${{ matrix.package }}-tests --command tests --xml=test-reports/junit.xml $threads_flag | |
| # This one is special, as it requires a tty. | |
| - name: β Test (TUI) | |
| id: test_tui | |
| if: ${{ matrix.package == 'hydra-tui' }} | |
| # https://giters.com/gfx/example-github-actions-with-tty | |
| # The default shell does not allocate a TTY which breaks some tests | |
| shell: 'script -q -e -c "bash {0}"' | |
| env: | |
| TERM: "xterm" | |
| run: | | |
| cd ${{ matrix.package }} | |
| mkdir -p test-reports | |
| nix develop .#${{ matrix.package }}-tests --command tests --xml=test-reports/junit.xml | |
| - name: π Publish test report & upload JUnit XML | |
| if: always() | |
| uses: ./.github/actions/publish-test-report | |
| with: | |
| report-path: ${{ matrix.package }}/test-reports/junit.xml | |
| check-name: tests / ${{ matrix.package }} (${{ matrix.os }}) | |
| artifact-name: junit-${{ matrix.package }}-${{ matrix.os }} | |
| # NOTE: This depends on the path used in hydra-cluster e2e tests | |
| - name: πΎ Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hydra-cluster-e2e-test-logs | |
| path: /tmp/nix-shell.*/hydra-cluster-e2e-*/logs/* | |
| if-no-files-found: ignore | |
| benchmarks: | |
| name: "Benchmarks" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - package: hydra-node | |
| bench: tx-cost | |
| tag: tx-cost | |
| options: '--output-directory $(pwd)/../benchmarks' | |
| - package: hydra-node | |
| bench: micro | |
| tag: micro | |
| options: '-o $(pwd)/../benchmarks/ledger-bench.html' | |
| - package: hydra-cluster | |
| bench: bench-e2e | |
| tag: e2e | |
| options: 'single datasets/1-node.json datasets/3-nodes.json --output-directory $(pwd)/../benchmarks --timeout 1000s' | |
| - package: hydra-cluster | |
| bench: bench-e2e | |
| tag: matrix | |
| # Skip the incremental-ops dimension in CI: per-cycle ~90s adds up | |
| # across cells and the cost is known/bounded. Local runs can still | |
| # opt in via `--incremental-modes False,True`. | |
| options: 'matrix --output-directory $(pwd)/../benchmarks --number-of-txs 30 --timeout 3600s --incremental-modes False' | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: β Setup Nix/Cachix | |
| uses: ./.github/actions/nix-cachix-setup | |
| with: | |
| authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}' | |
| - name: π Benchmark | |
| run: | | |
| mkdir -p benchmarks | |
| cd ${{ matrix.package }} | |
| nix build .#${{ matrix.package }}-bench | |
| nix develop .#${{ matrix.package }}-bench --command ${{ matrix.bench }} ${{ matrix.options }} | |
| - name: πΎ Upload build & test artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmarks-${{matrix.package}}-${{matrix.tag}} | |
| path: benchmarks | |
| # NOTE: This depends on the path used in hydra-cluster bench | |
| - name: πΎ Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hydra-cluster-bench-logs | |
| path: /tmp/nix-shell.*/bench-*/**/*.log | |
| if-no-files-found: ignore | |
| publish-benchmark-results: | |
| name: Publish benchmark results | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| # TODO: this is actually only requires the tx-cost benchmark results | |
| needs: [benchmarks] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Download generated documentation | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: artifact | |
| pattern: benchmarks-* | |
| merge-multiple: true | |
| - name: β Prepare comment body | |
| id: comment-body | |
| run: | | |
| # Drop first 5 header lines and demote headlines one level. Concatenate | |
| # tx costs, the existing single end-to-end run, and the matrix | |
| # scenarios so reviewers see every benchmark output in one PR comment. | |
| cat \ | |
| <(cat artifact/transaction-cost.md | sed '1,5d;s/^#/##/') \ | |
| <(cat artifact/end-to-end-benchmarks.md | sed '1,5d;s/^#/##/') \ | |
| <(cat artifact/scenarios.md | sed '1,5d;s/^#/##/') \ | |
| | grep -v '^:::' > comment-body.md | |
| - name: π Find Comment | |
| uses: peter-evans/find-comment@v3 | |
| id: find-comment | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: 'github-actions[bot]' | |
| body-includes: Transaction costs | |
| - name: β Create or update comment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
| edit-mode: replace | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-file: comment-body.md |