Skip to content

version 0.8.0

version 0.8.0 #541

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
CARGO_TERM_COLOR: always
CARGO_HOME: ${{ github.workspace }}/.cargo
RUSTFLAGS: -D warnings -A unused-imports
RUSTDOCFLAGS: -D warnings
RUST_BACKTRACE: full
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: ${{ matrix.basename }} - ${{ matrix.os }} - ${{ matrix.llvm[0] }} - ${{ matrix.features }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
llvm:
- ["15.0", "15-0", "150"]
- ["16.0", "16-0", "160"]
- ["17.0", "17-0", "170"]
- ["19.1", "19-1", "191", "19"]
- ["20.1", "20-1", "201", "20"]
- ["21.1", "21-1", "211", "21"]
toolchain:
- stable
os:
- ubuntu-latest
- macos-latest
features:
- "rayon cranelift"
experimental:
- false
tests:
- true
clippy:
- false
rustdoc:
- false
basename:
- Tests
include:
- toolchain: stable
os: ubuntu-latest
llvm: ["18.1", "18-1", "181"]
features: "rayon cranelift"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Tests
- toolchain: stable
os: macos-latest
llvm: ["18.1", "18-1", "181"]
features: "rayon cranelift"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Tests
- toolchain: stable
os: windows-latest
llvm: ""
features: "rayon cranelift"
tests: true
clippy: false
rustdoc: false
experimental: false
basename: Tests
- toolchain: beta
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Beta
- toolchain: nightly
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Nightly
- toolchain: stable
os: ubuntu-latest
llvm: ""
features: ""
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Tests
- toolchain: stable
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift"
tests: false
clippy: true
rustdoc: false
experimental: true
basename: Clippy
- toolchain: nightly
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift"
tests: false
clippy: false
rustdoc: true
experimental: true
basename: Rustdoc
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/cache@v3
with:
path: |
${{ env.CARGO_HOME }}
target
key: unit-test-${{ runner.os }}-${{ matrix.toolchain}}-${{ matrix.llvm[0] }}-${{ matrix.features }}
- 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 (LLVM >= 19.1 & macos)
if : matrix.llvm != '' && matrix.os == 'macos-latest' && (matrix.llvm[0] >= '19.1')
run: |
brew install llvm@${{ matrix.llvm[3] }}
echo "LLVM_PATH=$(brew --prefix llvm@${{ matrix.llvm[3] }})" >> $GITHUB_ENV
- name: Install LLVM and Clang (LLVM >= 19.1 & ubuntu)
if : matrix.llvm != '' && (matrix.os == 'ubuntu-latest'|| matrix.os == 'ubuntu-24.04-arm') && (matrix.llvm[0] >= '19.1')
run: |
sudo apt install --no-install-recommends -y lsb-release wget software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm[3] }}
sudo apt-get update
sudo apt install --no-install-recommends -y libllvm${{ matrix.llvm[3] }} \
llvm-${{ matrix.llvm[3] }} \
llvm-${{ matrix.llvm[3] }}-dev \
llvm-${{ matrix.llvm[3] }}-runtime \
libpolly-${{ matrix.llvm[3] }}-dev
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${{ matrix.llvm[3] }} 10
echo "LLVM_PATH=/usr/lib/llvm-${{ matrix.llvm[3] }}" >> $GITHUB_ENV
- name: Install LLVM and Clang (LLVM < 19.1)
uses: KyleMayes/install-llvm-action@v2
if : matrix.llvm != '' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'ubuntu-24.04-arm') && (matrix.llvm[0] < '19.1')
with:
version: ${{ matrix.llvm[0] }}
- name: Set LLVM_SYS_XXX_DIR and CC, CXX environment variables
if : matrix.llvm != ''
run: |
echo "LLVM_SYS_${{ matrix.llvm[2] }}_DIR=${LLVM_PATH}" >> $GITHUB_ENV
- name: Install LLVM 16 (macos-13)
if : matrix.os == 'macos-13'
run:
brew install llvm@16
- name: Install dependencies (for ubuntu-latest and LLVM 18.1)
if : matrix.llvm[0] == '18.1' && matrix.os == 'ubuntu-latest'
run: |
sudo apt update
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run tests (LLVM)
if : matrix.tests && matrix.llvm != ''
run: cargo test --verbose --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
- name: Run tests
if : matrix.tests && matrix.llvm == ''
run: cargo test --verbose --features "${{ matrix.features }}"
- name: Run Clippy (LLVM)
if: matrix.clippy
run: cargo clippy --verbose --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
- name: Run Docs (LLVM)
if: matrix.rustdoc
run: cargo rustdoc -p diffsl --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
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