Fix loop condition #201
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: | |
- master | |
paths-ignore: | |
- 'README.adoc' | |
pull_request: | |
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 | |
jobs: | |
build: | |
name: Build and test on Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build all | |
run: cargo build --workspace | |
- name: Build and install MiniSat shared library (libminisat.so) | |
working-directory: lib/minisat-sys/vendor/minisat | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Release | |
cmake --build build -- -j8 | |
sudo cmake --install build --strip --prefix /usr/local | |
- name: Build and install MiniSat-C shared library (libminisat-c.so) | |
working-directory: lib/minisat-sys/vendor/minisat-c-bindings | |
run: | | |
make config MINISAT_INCLUDE="-I/usr/local/include" | |
make config MINISAT_LIB="-L/usr/local/lib -lminisat" | |
make config prefix=/usr/local | |
sudo make install | |
- name: Build and install Cadical shared library (libcadical.so) | |
working-directory: lib/cadical-sys/vendor/cadical | |
run: | | |
./configure -fPIC | |
make -j8 shared | |
sudo install -m 644 build/libcadical.so -Dt /usr/local/lib | |
- name: Build and install Kissat shared library (libkissat.so) | |
working-directory: lib/kissat-sys/vendor/kissat | |
run: | | |
./configure --compact --no-options --no-proofs --quiet -shared | |
make -j8 | |
sudo install -m 644 build/libkissat.so -Dt /usr/local/lib | |
- name: Run ldconfig and update LD_LIBRARY_PATH | |
run: | | |
sudo ldconfig -n /usr/local/lib | |
ldconfig -p | |
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/local/lib" >> $GITHUB_ENV | |
- name: Upload shared libraries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: shared-libs | |
path: | | |
/usr/local/lib/libminisat.so | |
/usr/local/lib/libminisat-c.so | |
/usr/local/lib/libcadical.so | |
/usr/local/lib/libkissat.so | |
- name: Test all | |
run: cargo test --workspace | |
build-windows: | |
name: Build and test on Windows | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# Enable tmate debugging of manually-triggered workflows if the input option was provided | |
- name: Setup tmate session | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
detached: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable-gnu | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build all | |
run: cargo build --workspace | |
- name: Build MiniSat dynamic library | |
working-directory: lib/minisat-sys/vendor/minisat | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" | |
cmake --build build | |
cmake --install build --strip --prefix install | |
# Result: install/bin/libminisat.dll | |
- name: Build MiniSat-C dynamic library | |
working-directory: lib/minisat-sys/vendor/minisat-c-bindings | |
run: | | |
make config MINISAT_INCLUDE="-I../zlib -I../minisat/install/include" | |
make config MINISAT_LIB="-LC:/Strawberry/c/lib -L../minisat/install/lib -lminisat" | |
make config prefix=install | |
make install | |
mv install/lib/libminisat-c.so install/lib/minisat-c.dll | |
# Result: install/lib/minisat-c.dll | |
- name: Build Cadical dynamic library | |
working-directory: lib/cadical-sys/vendor/cadical | |
run: | | |
./configure -fPIC | |
make -j8 dll | |
# Result: build/cadical.dll | |
- name: Build Kissat dynamic library | |
working-directory: lib/kissat-sys/vendor/kissat | |
run: | | |
git fetch origin windows:windows --depth=1 | |
git switch windows | |
./configure --compact --quiet --no-options --no-proofs -shared | |
make -j8 | |
# Note: the resulting file `build/libkissat.so` is actually a DLL, just have a Linux-name! | |
cp build/libkissat.so build/kissat.dll | |
# Result: build/kissat.dll | |
- name: Copy DLLs to 'libs/' | |
run: | | |
mkdir -p libs | |
cp lib/minisat-sys/vendor/minisat/install/bin/libminisat.dll libs/ | |
cp lib/minisat-sys/vendor/minisat-c-bindings/install/lib/minisat-c.dll libs/ | |
cp lib/cadical-sys/vendor/cadical/build/cadical.dll libs/ | |
cp lib/kissat-sys/vendor/kissat/build/kissat.dll libs/ | |
ldd libs/*.dll | |
ls -al libs/*.dll | |
- name: Add 'libs/' to PATH | |
shell: pwsh | |
run: Add-Content $env:GITHUB_PATH "$((Get-Item libs).FullName)" | |
- run: $env:PATH | |
shell: pwsh | |
- name: Upload DLLs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DLLs | |
path: libs/ | |
- name: Test all | |
run: cargo test --workspace | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Run rustfmt | |
run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo clippy --workspace --tests |