feat: fetch task definitions from HF repo (workspace.yaml + tests/), … #61
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: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_RETRY: 10 | |
| RUST_BACKTRACE: short | |
| jobs: | |
| check: | |
| name: Format + Lint + Test + Build | |
| runs-on: blacksmith-32vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mold linker | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq mold clang | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache cargo registry + target | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: check-${{ runner.os }}-nightly-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| check-${{ runner.os }}-nightly- | |
| - name: Check formatting | |
| run: cargo +nightly fmt --all -- --check | |
| - name: Clippy | |
| run: cargo +nightly clippy --all-targets -- -D warnings | |
| - name: Run tests | |
| run: cargo +nightly test --release -j $(nproc) -- --test-threads=$(nproc) | |
| env: | |
| RUST_LOG: warn | |
| - name: Build release | |
| run: cargo +nightly build --release -j $(nproc) | |
| env: | |
| RUSTFLAGS: "-C debuginfo=0 -C link-arg=-fuse-ld=mold -D warnings" | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: term-executor-linux-x86_64 | |
| path: target/release/term-executor | |
| retention-days: 7 | |
| docker: | |
| name: Docker build | |
| runs-on: blacksmith-32vcpu-ubuntu-2404 | |
| needs: [check] | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lowercase repo name | |
| id: lower | |
| run: echo "repo=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ steps.lower.outputs.repo }}:latest | |
| ghcr.io/${{ steps.lower.outputs.repo }}:${{ github.sha }} | |
| release: | |
| name: Semantic Release | |
| runs-on: ubuntu-latest | |
| needs: [check] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install semantic-release | |
| run: npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/exec | |
| - name: Run semantic-release | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |