bc: rewrite the canonical builder loop into a transient form #135
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: [main] | |
| pull_request: | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CC: ${{ matrix.os == 'windows-latest' && 'gcc' || 'cc' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Compiler version | |
| run: | | |
| $CC --version | |
| # On ubuntu-latest the alt-versions are also available; print | |
| # them so a future regression that's gcc-13-specific (or | |
| # 12-specific) is easier to triage. | |
| if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | |
| for v in 12 13 14; do | |
| if command -v gcc-$v >/dev/null; then | |
| gcc-$v --version | head -1 | |
| fi | |
| done | |
| fi | |
| - name: Bootstrap mino | |
| # Generates the bundled-source headers and compiles ./mino in | |
| # one step. Anything beyond bootstrap belongs in `./mino task`. | |
| # Tee stderr so a build failure leaves a captured log for the | |
| # post-step summary below; the live step output stays | |
| # unchanged for anyone with log access. | |
| run: | | |
| set -o pipefail | |
| make 2>&1 | tee /tmp/build.log | |
| - name: Surface build failure | |
| # When the build step above fails, post the captured tail on | |
| # the job summary page so anyone with Actions UI access (incl. | |
| # signed-in external contributors) sees what broke without | |
| # having to download artifacts. | |
| if: failure() | |
| run: | | |
| { | |
| echo "## Build failure (${{ matrix.os }})" | |
| echo '' | |
| echo '```' | |
| tail -60 /tmp/build.log 2>/dev/null || echo '(no build log captured)' | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload build log on failure | |
| # Artifacts are downloadable from the Actions page anonymously | |
| # for public repositories, so this is the path for off-repo | |
| # observers (and for the project bot) to see the actual gcc | |
| # error output without needing log-download permission. | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log-${{ matrix.os }} | |
| path: /tmp/build.log | |
| retention-days: 7 | |
| - name: Test | |
| # Run the suite runner directly so stdout streams. `task test` | |
| # wraps the subprocess in sh!, which buffers output until exit; | |
| # under a hang, no diagnostic ever surfaces. | |
| run: ./mino tests/run.clj | |
| # Tests usually finish in seconds; a hang means a deadlock, not | |
| # a slow runner. Cap so we get diagnostic output instead of | |
| # waiting on the 6h job-default timeout. | |
| timeout-minutes: 8 | |
| # The Windows test suite has documented divergence: cmd.exe's | |
| # echo emits a trailing space before \n, which the proc-test | |
| # assertions do not strip. Build still must pass; tests are | |
| # informational on Windows until the suite is portable. | |
| continue-on-error: ${{ matrix.os == 'windows-latest' }} | |
| external-test-suite: | |
| name: external-test-suite (clojure-test-suite) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # The external test suite is a snapshot of jank-lang/clojure-test-suite | |
| # run against the current mino build. Each .cljc file runs in its own | |
| # `./mino` sub-process under a 30s timeout (handled by the driver), | |
| # so a segfault or hang in one file doesn't take down the rest. | |
| # Informational: the job reports the supported / failed / errored | |
| # counts but does not gate merges. | |
| continue-on-error: true | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: mino | |
| - name: Checkout clojure-test-suite | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: jank-lang/clojure-test-suite | |
| path: clojure-test-suite | |
| - name: Bootstrap mino | |
| working-directory: mino | |
| run: make | |
| - name: Run external suite | |
| working-directory: mino | |
| # The driver expects the suite as a sibling of mino/, which the | |
| # checkout layout above already gives us. tee the output so the | |
| # next step can pull the summary without re-running the suite. | |
| run: | | |
| set -o pipefail | |
| ./mino tests/clojure_test_suite.clj 2>&1 \ | |
| | tee /tmp/external_suite.log | |
| - name: Surface aggregate counts | |
| # Pull the summary block out of the captured log and post it as | |
| # the job summary so the Actions UI shows pass / fail counts | |
| # without scrolling. | |
| if: always() | |
| run: | | |
| { | |
| echo "## External test suite summary" | |
| echo '' | |
| echo '```' | |
| sed -n '/EXTERNAL TEST SUITE REPORT/,/Per-file raw results/p' \ | |
| /tmp/external_suite.log 2>/dev/null \ | |
| | head -100 || true | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| perf-gate: | |
| name: perf-gate (linux) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # Shared GitHub-hosted runners are CPU-noisy and the runner image | |
| # itself drifts (ubuntu-latest tracks the newest stable image), so | |
| # the perf-gate is informational here. Local runs and the dedicated | |
| # mino-bench workflow remain the authoritative signal. | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout mino at current SHA | |
| uses: actions/checkout@v4 | |
| with: | |
| path: mino-head | |
| - name: Checkout mino-bench | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: leifericf/mino-bench | |
| path: mino-bench | |
| submodules: recursive | |
| - name: Override mino submodule to this SHA | |
| working-directory: mino-bench | |
| run: | | |
| rm -rf mino | |
| cp -R ../mino-head mino | |
| - name: Bootstrap mino | |
| working-directory: mino-bench/mino | |
| run: make | |
| - name: Build bench binaries | |
| working-directory: mino-bench | |
| run: ./mino/mino task build | |
| - name: Run perf gate | |
| working-directory: mino-bench | |
| run: ./mino/mino task perf-gate |