name: CI
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_HTTP_TIMEOUT: "600"
CARGO_NET_RETRY: "10"
jobs:
rust-tests:
name: Rust Tests
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Setup vx
uses: loonghao/vx@main
with:
version: '0.8.0'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup tools (vx)
run: vx setup
- name: Add Rust components
run: vx rustup component add clippy rustfmt
- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Fix MSVC linker (remove Git's link.exe)
run: Remove-Item 'C:\Program Files\Git\usr\bin\link.exe' -Force -ErrorAction SilentlyContinue
shell: pwsh
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: vx just fmt-check
- name: Clippy
run: vx just lint
- name: Run tests
run: vx just test-all-features
- name: Run doc tests
run: vx just test-doc
docs:
name: Documentation
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Setup vx
uses: loonghao/vx@main
with:
version: '0.8.0'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup tools (vx)
run: vx setup
- name: Add Rust components
run: vx rustup component add clippy rustfmt
- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Fix MSVC linker (remove Git's link.exe)
run: Remove-Item 'C:\Program Files\Git\usr\bin\link.exe' -Force -ErrorAction SilentlyContinue
shell: pwsh
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build documentation
run: vx just doc-ci
env:
RUSTDOCFLAGS: "-D warnings"
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [rust-tests, docs]
if: always()
steps:
- name: Check results
run: |
echo "## CI Results" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.rust-tests.result }}" != "success" ]]; then
echo "❌ Rust tests failed" >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "✅ Rust tests passed" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.docs.result }}" != "success" ]]; then
echo "❌ Documentation failed" >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "✅ Documentation passed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ **All CI checks passed!**" >> $GITHUB_STEP_SUMMARY