> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Build projects with GitHub Actions

> Build Rust, Node.js, Python, and Go projects on Tensorlake runners with persistent caches.

Copy a workflow below into `.github/workflows/build.yml` after [connecting your repository](/github-actions/quickstart). Each example runs only when you select **Run workflow** in GitHub; commit it to your default branch first.

The examples use [persistent repository caches](/github-actions/caching) and fall back to temporary storage when a cache isn’t available. Change the [runner size](/github-actions/runners) to fit your build.

<Tabs>
  <Tab title="Rust">
    Build and test a Cargo project with a committed `Cargo.lock`. Compilation outputs persist between runs.

    ```yaml theme={null}
    name: Rust
    on:
      workflow_dispatch:
    permissions:
      contents: read
    jobs:
      build:
        runs-on: tensorlake-medium
        timeout-minutes: 60
        steps:
          - uses: actions/checkout@v6
          - uses: dtolnay/rust-toolchain@stable
          - name: Configure build cache
            run: |
              cache_root="${TENSORLAKE_CACHE_DIR:-$RUNNER_TEMP}"
              echo "CARGO_TARGET_DIR=$cache_root/cargo-target" >> "$GITHUB_ENV"
          - run: cargo build --locked
          - run: cargo test --locked
    ```
  </Tab>

  <Tab title="Node.js">
    Build a Node.js project with a committed `package-lock.json` and a `build` script in `package.json`. npm’s download cache persists; `npm ci` installs dependencies for each job.

    ```yaml theme={null}
    name: Node.js
    on:
      workflow_dispatch:
    permissions:
      contents: read
    jobs:
      build:
        runs-on: tensorlake-medium
        timeout-minutes: 60
        steps:
          - uses: actions/checkout@v6
          - uses: actions/setup-node@v6
            with:
              node-version: '24'
              package-manager-cache: false
          - name: Configure dependency cache
            run: |
              cache_root="${TENSORLAKE_CACHE_DIR:-$RUNNER_TEMP}"
              echo "npm_config_cache=$cache_root/npm" >> "$GITHUB_ENV"
          - run: npm ci
          - run: npm run build
    ```
  </Tab>

  <Tab title="Python">
    Install a Python project’s `requirements.txt` and run its `unittest` tests. pip reuses cached downloads while installing dependencies into the new runner.

    ```yaml theme={null}
    name: Python
    on:
      workflow_dispatch:
    permissions:
      contents: read
    jobs:
      test:
        runs-on: tensorlake-small
        timeout-minutes: 60
        steps:
          - uses: actions/checkout@v6
          - uses: actions/setup-python@v6
            with:
              python-version: '3.13'
          - name: Configure dependency cache
            run: |
              cache_root="${TENSORLAKE_CACHE_DIR:-$RUNNER_TEMP}"
              echo "PIP_CACHE_DIR=$cache_root/pip" >> "$GITHUB_ENV"
          - run: python -m pip install -r requirements.txt
          - run: python -m unittest discover
    ```
  </Tab>

  <Tab title="Go">
    Build and test a Go module using the version in `go.mod`. Both module downloads and compiled outputs persist between runs.

    ```yaml theme={null}
    name: Go
    on:
      workflow_dispatch:
    permissions:
      contents: read
    jobs:
      build:
        runs-on: tensorlake-medium
        timeout-minutes: 60
        steps:
          - uses: actions/checkout@v6
          - uses: actions/setup-go@v6
            with:
              go-version-file: go.mod
              cache: false
          - name: Configure build cache
            run: |
              cache_root="${TENSORLAKE_CACHE_DIR:-$RUNNER_TEMP}"
              echo "GOMODCACHE=$cache_root/go-mod" >> "$GITHUB_ENV"
              echo "GOCACHE=$cache_root/go-build" >> "$GITHUB_ENV"
          - run: go build ./...
          - run: go test ./...
    ```
  </Tab>
</Tabs>
