rewrite QwenPreamble: self-aware, tighter, plan-act-verify for 3.8 #156
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: Linux arm64 | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['[0-9]+.[0-9]+.[0-9]+'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore Nim toolchain cache | |
| id: cache-nim | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/nim-toolchain | |
| key: ${{ runner.os }}-${{ runner.arch }}-nim-toolchain-${{ hashFiles('*.nimble') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-nim-toolchain- | |
| - uses: jiro4989/setup-nim-action@v2 | |
| if: steps.cache-nim.outputs.cache-hit != 'true' | |
| with: | |
| nim-version: stable | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| parent-nim-install-directory: $HOME | |
| nim-install-directory: nim-toolchain | |
| - name: Add Nim to PATH on cache hit | |
| if: steps.cache-nim.outputs.cache-hit == 'true' | |
| run: echo "$HOME/nim-toolchain/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| # sandwall is not on the public package registry; install it from | |
| # its git URL first so --depsOnly can resolve it from the local store. | |
| run: | | |
| nimble install -y https://github.com/capocasa/sandwall | |
| nimble install -y --depsOnly | |
| - name: Compute build flags | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| # autoupdate on releases only | |
| echo "BUILD_FLAGS=-d:autoUpdate" >> "$GITHUB_ENV" | |
| fi | |
| - name: Build | |
| run: nimble build -y -d:release ${{ env.BUILD_FLAGS }} | |
| - name: Run tests | |
| # nimble's nimscript task swallows a non-zero testament exit (it | |
| # converts the OSError into a logged exception but still exits 0), | |
| # so a failing test reports green. Call testament directly and | |
| # propagate $? so a test failure actually fails the step. | |
| # | |
| # Run categories sequentially rather than via `all` (which fan-outs | |
| # every category in parallel). The tty PTY tests spawn real | |
| # subprocesses whose render threads are scheduler-sensitive; under | |
| # load the parallel fan-out starves those threads and produces | |
| # load-induced frame mismatches. Sequential `cat` runs the identical | |
| # tests without that contention. | |
| run: | | |
| if command -v testament >/dev/null 2>&1; then | |
| for c in core config shell stream api tty; do | |
| testament --print --megatest:off cat "$c" || exit 1 | |
| done | |
| else | |
| for d in tests/*/; do | |
| for f in "$d"*.nim; do | |
| nim c -r --path:src --path:tests "$f" || exit 1 | |
| done | |
| done | |
| fi | |
| timeout-minutes: 25 | |
| - name: Package | |
| run: | | |
| mkdir -p 3code-linux-arm64 | |
| cp 3code 3code-linux-arm64/ | |
| # Capture the version from the built binary so it can be checked | |
| # without running the binary on its target OS. | |
| ./3code -v > 3code-linux-arm64/VERSION | |
| cp README.md LICENSE 3code-linux-arm64/ | |
| tar czf 3code-linux-arm64.tar.gz 3code-linux-arm64 | |
| - name: Upload artifact (GitHub Actions) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 3code-linux-arm64 | |
| path: 3code-linux-arm64.tar.gz | |
| - name: Upload artifact to 3code.capocasa.dev | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| curl -f -H "Authorization: Bearer ${{ secrets.RELEASE_SECRET }}" -F "file=@3code-linux-arm64.tar.gz" \ | |
| https://3code.capocasa.dev/main/builds/upload.nim |