add llvm to include #234
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_HOME: ${{ github.workspace }}/.cargo | |
RUSTFLAGS: -D warnings -A unused-imports | |
RUSTDOCFLAGS: -D warnings | |
RUST_BACKTRACE: ful | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update stable --no-self-update | |
- run: rustc -Vv | |
- run: cargo fmt --all -- --check | |
unit-tests: | |
name: Tests - ${{ matrix.os }} - ${{ matrix.toolchain }} - ${{ matrix.llvm }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
llvm: | |
- "14" | |
- "15" | |
- "16" | |
- "17" | |
toolchain: | |
- stable | |
os: | |
- ubuntu-latest | |
include: | |
- toolchain: beta | |
os: ubuntu-latest | |
llvm: "14" | |
- toolchain: nightly | |
os: ubuntu-latest | |
llvm: "14" | |
- toolchain: stable | |
os: macos-13 | |
llvm: "14" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/cache@v3.3.2 | |
with: | |
path: | | |
${{ env.CARGO_HOME }} | |
target | |
key: unit-test-${{ runner.os }}-${{ matrix.toolchain}}-${{ matrix.llvm }} | |
- name: Set up Rust | |
run: rustup default ${{ matrix.toolchain }} && rustup update ${{ matrix.toolchain }} --no-self-update && rustup component add clippy rust-docs | |
- name: Rust version | |
run: rustc -Vv | |
- name: Install LLVM and Clang (Ubuntu) | |
uses: KyleMayes/install-llvm-action@v2 | |
if : matrix.os == 'ubuntu-latest' | |
with: | |
version: ${{ matrix.llvm }}.0 | |
- name: Install LLVM and Clang (macOS) | |
if : matrix.os == 'macos-13' | |
run: | | |
brew install llvm@${{ matrix.llvm }} | |
echo "LLVM_SYS_${{ matrix.llvm }}0_PREFIX=/usr/local/opt/llvm@${{ matrix.llvm }}" >> $GITHUB_ENV | |
echo "LLVM_DIR=/usr/local/opt/llvm@${{ matrix.llvm }}" >> $GITHUB_ENV | |
- name: Run tests | |
run: cargo test --verbose --features llvm${{ matrix.llvm }}-0 | |
- name: Run Clippy | |
if: matrix.toolchain == 'stable' | |
run: cargo clippy --verbose --features llvm${{ matrix.llvm }}-0 | |
- name: Run Docs | |
if: matrix.toolchain == 'nightly' | |
run: cargo rustdoc --features llvm${{ matrix.llvm }}-0 | |
book: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: 'latest' | |
- run: mdbook build book | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./book/book |