| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
|
| 11 |
jobs: |
| 12 |
fmt: |
| 13 |
name: Check formatting |
| 14 |
runs-on: ubuntu-latest |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v4 |
| 18 |
- run: cargo fmt -- --check |
| 19 |
|
| 20 |
test: |
| 21 |
name: Test |
| 22 |
runs-on: ${{ matrix.os }} |
| 23 |
strategy: |
| 24 |
matrix: |
| 25 |
os: [macos-latest, ubuntu-latest, windows-latest] |
| 26 |
clang: [["14.0", "clang_14_0"]] |
| 27 |
rust: ["1.60.0"] |
| 28 |
steps: |
| 29 |
- name: Checkout Repository |
| 30 |
uses: actions/checkout@v4 |
| 31 |
# LLVM and Clang |
| 32 |
- name: Install LLVM and Clang |
| 33 |
uses: KyleMayes/[email protected] |
| 34 |
with: |
| 35 |
version: ${{ matrix.clang[0] }} |
| 36 |
directory: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }} |
| 37 |
# Rust |
| 38 |
- name: Install Rust |
| 39 |
uses: dtolnay/rust-toolchain@stable |
| 40 |
with: |
| 41 |
toolchain: ${{ matrix.rust }} |
| 42 |
# Cargo |
| 43 |
- name: Generate lockfile and pin dependencies for MSRV |
| 44 |
run: cargo generate-lockfile && cargo update -p libc --precise 0.2.163 && cargo update -p glob --precise 0.3.2 && cargo update -p libloading --precise 0.8.8 |
| 45 |
# Test |
| 46 |
- name: Cargo Test (Dynamic) |
| 47 |
run: cargo test --verbose --features ${{ matrix.clang[1] }} -- --nocapture |
| 48 |
- name: Cargo Test (Runtime) |
| 49 |
run: cargo test --verbose --features "${{ matrix.clang[1] }} runtime" -- --nocapture |
| 50 |
test-bindgen: |
| 51 |
name: Test (bindgen) |
| 52 |
runs-on: ubuntu-latest |
| 53 |
steps: |
| 54 |
- name: Checkout Repository |
| 55 |
uses: actions/checkout@v4 |
| 56 |
# LLVM and Clang |
| 57 |
- name: Install LLVM and Clang |
| 58 |
uses: KyleMayes/[email protected] |
| 59 |
with: |
| 60 |
version: 14 |
| 61 |
directory: ${{ runner.temp }}/llvm |
| 62 |
# Rust |
| 63 |
- name: Install Rust |
| 64 |
uses: dtolnay/rust-toolchain@stable |
| 65 |
# Test |
| 66 |
- name: Cargo Run (bindgen-test) |
| 67 |
run: cargo run --manifest-path bindgen-test/Cargo.toml |