fix linux #13
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: Rust | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
RUSTFLAGS: "-D warnings" | |
Z3_RELEASE: 'z3-4.12.1' | |
RUST_BACKTRACE: 'full' | |
jobs: | |
check-formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check formatting | |
run: cargo fmt -- --check | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
link: [download, build, system] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 | |
uses: KyleMayes/install-llvm-action@v1 | |
if: matrix.os == 'windows-latest' | |
with: | |
version: "11.0" | |
directory: ${{ runner.temp }}/llvm | |
- name: Set LIBCLANG_PATH | |
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | |
if: matrix.os == 'windows-latest' | |
- name: Uninstall Z3 on Linux for non-system builds | |
if: matrix.os == 'ubuntu-latest' && matrix.link != 'system' | |
run: sudo apt-get remove libz3-dev | |
- name: enable homebrew | |
if: matrix.os == 'macos-latest' && matrix.link == 'system' | |
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | |
- name: Install Z3 on macos | |
if: matrix.os == 'macos-latest' && matrix.link == 'system' | |
run: yes | brew install z3 | |
- name: Install Z3 on Windows for system builds | |
if: matrix.os == 'windows-latest' && matrix.link == 'system' | |
run: | | |
mkdir .tmp | |
curl.exe -L "https://github.com/Z3Prover/z3/releases/download/${env:Z3_RELEASE}/${env:Z3_RELEASE}-x64-win.zip" -o ".tmp/${env:Z3_RELEASE}-x64-win.zip" | |
tar -xf ".tmp/${env:Z3_RELEASE}-x64-win.zip" -C ".tmp" | |
echo "${PWD}\.tmp\${env:Z3_RELEASE}-x64-win\bin" >> $env:GITHUB_PATH | |
echo "LIB=${PWD}\.tmp\${env:Z3_RELEASE}-x64-win\bin" >> $env:GITHUB_ENV | |
echo "Z3_SYS_Z3_HEADER=${PWD}\.tmp\${env:Z3_RELEASE}-x64-win\include\z3.h" >> $env:GITHUB_ENV | |
- name: Config rust for windows | |
if: matrix.os == 'windows-latest' | |
run: rustup set default-host x86_64-pc-windows-msvc | |
- if: matrix.link == 'system' | |
run: cargo build -vv --workspace --all-targets | |
- if: matrix.link == 'build' | |
run: cargo build -vv --workspace --all-targets --features force-build-z3 | |
- if: matrix.link == 'download' | |
run: cargo build -vv --workspace --all-targets --features static-link-z3 | |
- if: matrix.link == 'system' | |
run: cargo test -vv --all | |
- if: matrix.link == 'build' | |
run: cargo test -vv --all --features force-build-z3 | |
- if: matrix.link == 'download' | |
run: cargo test -vv --all --features static-link-z3 | |
- name: Run tests with `arbitrary-size-numeral` enabled | |
if: matrix.link == 'system' | |
run: cargo test --manifest-path z3/Cargo.toml -vv --features=arbitrary-size-numeral | |
- name: Run tests with `arbitrary-size-numeral` enabled | |
if: matrix.link == 'build' | |
run: cargo test --manifest-path z3/Cargo.toml -vv --features=arbitrary-size-numeral --features=force-build-z3 | |
- name: Run tests with `arbitrary-size-numeral` enabled | |
if: matrix.link == 'download' | |
run: cargo test --manifest-path z3/Cargo.toml -vv --features=arbitrary-size-numeral --features=static-link-z3 | |
build_on_wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install emscripten | |
run: | | |
cd ~ | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
git pull | |
./emsdk install latest | |
./emsdk activate latest | |
source ./emsdk_env.sh | |
- name: Install wasm32-unknown-emscripten target | |
run: rustup target add wasm32-unknown-emscripten | |
- name: Build z3-sys and z3 with statically linked Z3 | |
run: | | |
source ~/emsdk/emsdk_env.sh | |
cargo build --target=wasm32-unknown-emscripten -vv --features static-link-z3 | |
run_clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Run clippy | |
run: cargo clippy -vv --features force-build-z3 --lib --tests |