name: CI
on:
pull_request:
push:
branches: [main]
env:
RUSTFLAGS: -D warnings
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Release-shape gate self-tests
run: python3 -m unittest discover -s scripts -p 'test_*.py' -v
- name: Release shape and version ladder
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python3 scripts/check-release.py "$BASE_SHA" "$HEAD_SHA"
- name: Format
run: cargo fmt --check
- name: Clippy (debug)
run: cargo clippy --all-targets -- -D warnings
- name: Clippy (release)
run: cargo clippy --release --all-targets -- -D warnings
- name: Build (debug)
run: cargo build
- name: Build (release)
run: cargo build --release
- name: Unit tests (debug)
run: cargo test --bin scsh
- name: Unit tests (release)
run: cargo test --release --bin scsh
- name: Integration tests (debug)
run: cargo test --test cli
- name: Integration tests (release)
run: cargo test --release --test cli