datahaven/.github/workflows/task-rust-lint.yml
Steve Degosserie 62393dee23
ci: migrate from self-hosted to standard GitHub runners (#482)
## Summary
- Self-hosted `DH-runners` have been decommissioned — all Rust build,
test, and lint workflows now use `ubuntu-latest`
- Removed `install-deps: false` overrides so workflows use the default
apt-based dependency installation path
- Updated `setup-env` action descriptions to remove self-hosted runner
references

### Workflows updated
- `task-build-operator.yml`
- `task-build-static-operator.yaml`
- `task-publish-binary.yml`
- `task-rust-lint.yml` (3 jobs)
- `task-rust-tests.yml`
- `task-warm-sccache.yml`
- `task-e2e.yml`

## Test plan
- [x] Verify all Rust CI jobs pass on `ubuntu-latest` (build, lint,
test, warm-cache)
- [x] Confirm sccache and dependency installation work correctly on
standard runners
- [x] Ensure E2E workflow runs with Docker (instead of Podman) on
standard runners

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 23:11:39 +02:00

100 lines
2.9 KiB
YAML

# Lint and Format: CI for Rust components (DataHaven runtime and node Rust tests)
#
# Overview:
# 1. Check Rust Format: Check that the Rust code is formatted correctly
# 2. Check Rust Lint: Check that the Rust code is linted correctly
name: Lint and Format
on:
workflow_call:
workflow_dispatch:
inputs:
pull_request:
description: set to pull_request number to execute on external pr
required: false
# Explicit minimal permissions
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
WORKING_DIR: operator
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
cargo-fmt:
name: "Check format with rustfmt"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/setup-env
with:
cache-key: FMT
- name: Run cargo fmt
run: cargo fmt --all -- --check
check-rust-lint:
name: "Check lint with clippy"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/setup-env
with:
cache-key: LINT
- name: Set build flags
run: echo "RUSTFLAGS=${{ env.RUSTFLAGS }} -C linker=clang -C link-arg=-fuse-ld=mold" >> $GITHUB_ENV
- name: Run cargo clippy
run: SKIP_WASM_BUILD=1 cargo clippy --features try-runtime,runtime-benchmarks --locked --release
check-cargo-sort:
name: "Check Cargo sort"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- name: Check out the repository to the runner
uses: actions/checkout@v4
- name: Install taplo locally
run: |
# Install taplo in user space without sudo
TAPLO_VERSION="0.8.1"
# SHA256 checksum for taplo-full-linux-x86_64.gz (decompressed binary)
TAPLO_SHA256="c62baa73c9d7c1572047b1a502ca805e1372e5db7c9a935532f702f12d6115ce"
if ! command -v taplo &> /dev/null || [[ $(taplo --version | grep -oP '\d+\.\d+\.\d+' | head -1) != "$TAPLO_VERSION" ]]; then
echo "Installing taplo $TAPLO_VERSION in ~/.local/bin"
mkdir -p ~/.local/bin
curl -Ls "https://github.com/tamasfe/taplo/releases/download/${TAPLO_VERSION}/taplo-full-linux-x86_64.gz" | \
gzip -d > ~/.local/bin/taplo
# Verify checksum before making executable
echo "Verifying taplo checksum..."
echo "${TAPLO_SHA256} $HOME/.local/bin/taplo" | sha256sum -c -
chmod +x ~/.local/bin/taplo
echo "$HOME/.local/bin" >> $GITHUB_PATH
export PATH="$HOME/.local/bin:$PATH"
else
echo "taplo is already installed: $(taplo --version)"
fi
- run: taplo fmt --check
- run: taplo lint