name: CI
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test & lint (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Format
if: matrix.os == 'ubuntu-latest' run: cargo fmt --all --check
- name: Clippy (all features, warnings denied)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test (all features)
run: cargo test --all-features
static:
name: Static library (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl }
- { os: ubuntu-latest, target: i686-unknown-linux-musl }
- { os: ubuntu-latest, target: armv7-unknown-linux-musleabihf }
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build libdldota.a
run: cargo build --release --target ${{ matrix.target }}
- name: Check exported C symbols
run: |
nm -g --defined-only target/${{ matrix.target }}/release/libdldota.a 2>/dev/null \
| grep -E ' T dldota_' | tee /dev/stderr \
| grep -c ' T dldota_' | grep -qx 11
cross:
name: Static host on ${{ matrix.target }} (glibc + musl loaders)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl }
- { os: ubuntu-latest, target: i686-unknown-linux-musl }
- { os: ubuntu-latest, target: armv7-unknown-linux-musleabihf, qemu: arm }
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
key: cross-${{ matrix.target }}
- name: Set up qemu-user
if: matrix.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.qemu }}
- name: Build and run the tests
run: scripts/cross-tests.sh ${{ matrix.target }}
fullrust:
name: fullrust static host (glibc + musl loaders)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check the libraries the tests load
run: dpkg -s zlib1g libzstd1 | grep -E '^(Package|Version):'
- name: Build with fullrust and run the tests
run: scripts/fullrust-tests.sh
- name: Pending tests (expected to fail for now)
continue-on-error: true
env:
DLDOTA_DEBUG: "1"
run: scripts/fullrust-tests.sh --include-ignored --test-threads=1
msrv:
name: MSRV (1.95)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust 1.95
uses: dtolnay/rust-toolchain@1.95
- name: Check
run: cargo check --all-targets