-
Notifications
You must be signed in to change notification settings - Fork 114
146 lines (138 loc) · 4.46 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUSTFLAGS: "-D warnings"
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt -- --check
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Z3 (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libz3-dev
- name: Install Z3 (macOS)
if: matrix.os == 'macos-latest'
run: brew install z3
- name: Run tests
run: cargo test --workspace
# XXX: Ubuntu's Z3 package seems to be missing some symbols, like
# `Z3_mk_pbeq`, leading to linker errors. Just ignore this, I guess, until
# we figure out how to work around it. At least we have the
# build using a bundled Z3 below...
if: ${{ success() || failure() }}
build_on_wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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 bundled Z3
run: |
source ~/emsdk/emsdk_env.sh
cargo build --target=wasm32-unknown-emscripten --features bundled
build_with_bundled_z3:
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
- build: macos
os: macos-latest
- build: windows
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
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: Test `z3-sys` and `z3` with bundled linked Z3
run: cargo test --workspace --features bundled
build_with_vcpkg_installed_z3:
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
vcpkg_triplet: x64-linux
- build: macos
os: macos-latest
vcpkg_triplet: x64-osx
- build: windows
os: windows-latest
vcpkg_triplet: x64-windows-static-md
runs-on: ${{ matrix.os }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v4
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'
- run: echo Instaling z3:${{ matrix.vcpkg_triplet }} on ${{ matrix.os }}.
- name: vcpkg build z3
uses: johnwason/vcpkg-action@v5
id: vcpkg
with:
pkgs: z3
triplet: ${{ matrix.vcpkg_triplet }}
cache-key: ${{ matrix.os }}
revision: master
token: ${{ github.token }}
extra-args: --clean-buildtrees-after-build
- name: Show default toolchain of rust.
run: rustup default
- name: Test `z3-sys` and `z3` with vcpkg installed Z3
run: cargo test --workspace --features vcpkg
run_clippy:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Z3
run: brew install z3
- name: Run clippy
run: cargo clippy --workspace --all-targets