Skip to content

hotfix: add local CI support #64

hotfix: add local CI support

hotfix: add local CI support #64

Workflow file for this run

name: CI
on:
push:
branches: [main, dev, release/*, feature/*]
pull_request:
branches: [main, dev, release/*]
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: Rust ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (GitHub)
if: github.server_url == 'https://github.com'
uses: dtolnay/rust-toolchain@stable
- name: Install Rust (Forgejo)
if: github.server_url != 'https://github.com'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Build workspace
run: cargo build --workspace --all-features
- name: Run tests
run: cargo test --workspace --all-features
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: [rust]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (GitHub)
if: github.server_url == 'https://github.com'
uses: dtolnay/rust-toolchain@stable
- name: Install Rust (Forgejo)
if: github.server_url != 'https://github.com'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run integration tests
run: cargo test --workspace --all-features --test '*'
- name: Run doc tests
run: cargo test --workspace --doc