hub: retry transient HF downloads on network errors (#17) #46
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: | |
| # Self-hosted runner safety: a push only happens with write access, but a | |
| # pull_request can come from an external fork. Gate every job so PR runs execute | |
| # on the laptop runner ONLY for branches pushed into THIS repo (i.e. by someone | |
| # with write access) targeting main/dev; fork PRs have a different | |
| # head.repo.full_name and are skipped (have a maintainer push the branch into | |
| # the repo, or re-run after review). The earlier author_association check | |
| # skipped legitimate maintainer PRs, so this mirrors the engine repo's guard. | |
| # Also turn on "Require approval for all outside collaborators" in repo Actions | |
| # settings before making this repo public. | |
| jobs: | |
| base-convert: | |
| name: base-convert (build + test) | |
| if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && (github.base_ref == 'main' || github.base_ref == 'dev')) | |
| runs-on: [self-hosted, macOS, ARM64, m4pro] | |
| defaults: | |
| run: | |
| working-directory: base-convert | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo build --all | |
| - run: cargo test --all | |
| node-binding: | |
| name: node binding (build + unit tests) | |
| if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && (github.base_ref == 'main' || github.base_ref == 'dev')) | |
| runs-on: [self-hosted, macOS, ARM64, m4pro] | |
| defaults: | |
| run: | |
| working-directory: bindings/node | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - run: npm install | |
| - run: npx tsc | |
| - run: npm test # struct-ABI + helper tests; no engine needed | |
| rust-sys-abi: | |
| name: rust-sys ABI checks | |
| if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && (github.base_ref == 'main' || github.base_ref == 'dev')) | |
| runs-on: [self-hosted, macOS, ARM64, m4pro] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| # The sys crate links the engine; pull the latest release if one exists so | |
| # the ABI tests can build + run. Skips gracefully before the first release. | |
| - name: Fetch engine | |
| id: engine | |
| run: | | |
| mkdir -p build | |
| if gh release download --repo ${{ github.repository }} \ | |
| --pattern 'baseRT-engine-macos-arm64*.tar.gz' -D build 2>/dev/null; then | |
| tar -xzf build/baseRT-engine-macos-arm64*.tar.gz -C build | |
| echo "have=1" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "no engine release yet — skipping engine-linked tests" | |
| echo "have=0" >> "$GITHUB_OUTPUT" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: cargo test (baseRT-sys) | |
| if: steps.engine.outputs.have == '1' | |
| working-directory: bindings/rust/baseRT-sys | |
| run: cargo test | |
| env: | |
| BASERT_LIB_DIR: ${{ github.workspace }}/build |