Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Futz around with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanventer committed Oct 24, 2023
1 parent e9de993 commit c160189
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 37 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/mirai_on_mirai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: MIRAI on MIRAI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build_with_vcpkg_installed_z3:
strategy:
matrix:
build: [macos, windows] #[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@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'
- run: echo Installing 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: Install MIRAI
run: |
cargo install --force --path ./checker
- name: Run MIRAI on MIRAI
run: |
cargo mirai
82 changes: 49 additions & 33 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MIRAI on MIRAI
name: Continuous Integration

on:
push:
Expand All @@ -7,50 +7,66 @@ on:
branches: [ main ]

jobs:
build_with_vcpkg_installed_z3:
strategy:
matrix:
build: [windows] # [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
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.5.2

- name: Run Clippy
run: |
cargo clippy --no-default-features --all-targets -- -D warnings
tests:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.5.2
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 Installing 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 }}
triplet: x64-osx
cache-key: macos-latest
revision: master
token: ${{ github.token }}
extra-args: --clean-buildtrees-after-build

- name: Execute tests
run: |
cargo test --all -- --test-threads=1
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"

- name: Setup grcov
run: |
cargo install grcov
- name: Run grcov
run: |
zip -0 cov.zip $(find . -name "mirai*.gc*" -print)
grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload coverage data to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "lcov.info"

mirai_on_mirai_ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.5.2

- name: Install MIRAI
run: |
cargo install --force --path ./checker
cargo install --force --path ./checker --no-default-features --features static-link-z3
- name: Run MIRAI on MIRAI
run: |
cargo mirai
cargo mirai --no-default-features
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ shellwords = "*"
sled = "*"
tar = "0.4.38"
tempfile = "*"
z3-sys = { version = "*", git="https://github.com/prove-rs/z3.rs.git", features = ["vcpkg"], optional = true }
z3-sys = { version = "*", git="https://github.com/prove-rs/z3.rs.git", optional = true }

[dev-dependencies]
walkdir = "*"
Expand All @@ -65,6 +65,6 @@ contracts = { version = "0.6.0", features = ["mirai_assertions"] }

[features]
default = ["z3"]
z3 = ["dep:z3-sys"]

z3 = ["z3-sys/vcpkg"]
static-link-z3 = ["z3-sys/static-link-z3"]

0 comments on commit c160189

Please sign in to comment.