Run Sorus from CI

Add a Sorus test job to GitHub Actions and report its result on the commit.

You need an authorised repository and permission to manage CI secrets. Complete the first Cargo check before connecting automation.

Run a CI job

Create a credential with read and submit scopes using the authentication guide. Store its value as the Actions secret SORUS_TOKEN.

The following workflow tests pushes to main and can also be started manually. Adjust the branch and Cargo arguments to match your existing check:

name: Rust tests

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: sorus-run/setup-sorus@v0.3.0
        with:
          version: 0.3.0
      - name: Run workspace tests
        env:
          SORUS_TOKEN: ${{ secrets.SORUS_TOKEN }}
        run: cargo sorus test --workspace --locked --check-commit "$GITHUB_SHA" --check-name "lathe / tests"

The setup action installs the public client. No Rust compilation runs on the Actions runner: it captures the checkout, submits the job and waits for the result. Sorus reads the repository’s Rust toolchain selection. Checkout, packaging and deployment stay in your existing workflow.

In another CI system, install the same client with the public installer, check out the repository and inject SORUS_TOKEN into the calling process.

GitHub Actions and other CI systems

Keep the same source, toolchain, features, profile and test arguments as the existing CI step. --locked uses the committed dependency resolution. Make an intentional comparison before changing those inputs or the test runner.

Decide which pull requests may use your credential before adding a pull-request trigger. Fork code must not receive a privileged token. Do not switch to a privileged event solely to expose a secret to an untrusted checkout.

Report a GitHub check

--check-commit <sha> publishes the result through the GitHub App installation connected to your Sorus account. It needs access to the repository and permission to write checks; the token used to submit the job does not replace that installation.

The default check name is lathe. A custom name must use lathe / <label>, as in the workflow above, and contain at most 100 printable ASCII characters. Give separate jobs different names so their results do not share a check run. Use the commit actually checked out, especially in pull-request workflows where a merge commit may differ from the branch head.

After the first run, confirm that the check appears on the expected commit and that its conclusion matches the workload result.

Handle failures

Keep the job identifier. Exit 1 reports a workload outcome; exit 4 means the result was not observed and the job may still run; exit 5 means a terminal platform failure. Inspect the original job before resubmitting it. The job recovery guide gives the next step for each exit code.

A fallback should preserve that distinction. A platform failure is neither a passing check nor evidence that the tests failed.

Require a check

Compare Sorus with your existing CI on matching inputs before making the check required. Record differences and retain a working fallback until your team accepts the results. For performance comparisons, follow the benchmark method.