name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install system dependencies
run: sudo apt-get install -y libclang-dev
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
- name: Lint
run: cargo clippy --all-targets -- -D warnings
env:
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: sudo apt-get install -y libclang-dev
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --locked --verbose
env:
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
check:
name: Cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: sudo apt-get install -y libclang-dev
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
- name: Cargo check
run: cargo check --locked
env:
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
dotnet-tool:
name: .NET tool launcher build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build .NET tool launcher
run: dotnet build nuget/onde-cli/Onde.Cli.csproj --configuration Release
dart-package:
name: Dart pub package check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1
- name: Get package dependencies
working-directory: pub/onde_cli
run: dart pub get
- name: Analyze Dart package
working-directory: pub/onde_cli
run: dart analyze
build:
name: Build (aarch64-apple-darwin)
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
- name: Build release binary
run: cargo build --release --locked --target aarch64-apple-darwin
env:
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
ci:
name: CI status
runs-on: ubuntu-latest
needs:
- fmt
- clippy
- test
- check
- dotnet-tool
- dart-package
- build
if: always()
steps:
- name: Verify all required jobs succeeded
run: |
test "${{ needs.fmt.result }}" = "success"
test "${{ needs.clippy.result }}" = "success"
test "${{ needs.test.result }}" = "success"
test "${{ needs.check.result }}" = "success"
test "${{ needs.dotnet-tool.result }}" = "success"
test "${{ needs.dart-package.result }}" = "success"
test "${{ needs.build.result }}" = "success"