Skip to content

Commit

Permalink
add a CI (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot authored Sep 6, 2024
1 parent bcbc6f8 commit f58cc7f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/bolts-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Bolts CI
on:
pull_request:
push:
branches:
- main
jobs:
tests:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, linux]
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
JVM_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Install stainless and solvers
run: ./install_stainless_and_solvers.sh $GITHUB_WORKSPACE/.local/bin $GITHUB_WORKSPACE/.local
- name: Add stainless to PATH
run: echo "$GITHUB_WORKSPACE/.local/stainless/frontends/dotty/target/universal/stage/bin" >> $GITHUB_PATH
- name: Test stainless availability
run: stainless-dotty --version
- name: Add solvers to PATH
run: echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
- name: Test solvers availability
run: cvc5 --version && z3 --version && cvc4 --version
- name: Bolts Tests
run: ./run_tests.sh
fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: [self-hosted, linux]
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and tests workflows need to pass.
run: exit 1
37 changes: 37 additions & 0 deletions install_stainless_and_solvers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
TEMP_DIR="temp"
SOLVERS_DIR="$1"
STAINLESS_DIT="$2"

mkdir -p "$SOLVERS_DIR"
mkdir -p "$TEMP_DIR"
mkdir -p "$STAINLESS_DIR"

# stainless
cd "$STAINLESS_DIR"
git clone https://github.com/epfl-lara/stainless
cd stainless
sbt universal:stage

# cvc5
wget https://github.com/cvc5/cvc5/releases/download/cvc5-1.1.2/cvc5-Linux-static.zip -O "$TEMP_DIR/downloaded.zip" -q
unzip "$TEMP_DIR/downloaded.zip" -d "$TEMP_DIR"
CVC5_DIR=$(ls "$TEMP_DIR" | grep cvc5)
mv "$TEMP_DIR/$CVC5_DIR/bin/cvc5" "$SOLVERS_DIR/cvc5"
chmod +x "$SOLVERS_DIR/cvc5"
rm -rf "$TEMP_DIR"

# CVC4
wget https://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/cvc4-1.8-x86_64-linux-opt -O "$SOLVERS_DIR/cvc4" -q
chmod +x "$SOLVERS_DIR/cvc4"

# z3
mkdir -p "$TEMP_DIR"
wget https://github.com/Z3Prover/z3/releases/download/z3-4.13.0/z3-4.13.0-x64-glibc-2.35.zip -O "$TEMP_DIR/downloaded.zip" -q
unzip "$TEMP_DIR/downloaded.zip" -d "$TEMP_DIR"
Z3_DIR=$(ls "$TEMP_DIR" | grep z3)
mv "$TEMP_DIR/$Z3_DIR/bin/z3" "$SOLVERS_DIR/z3"
chmod +x "$SOLVERS_DIR/z3"
rm -rf "$TEMP_DIR"

echo "************** Solvers Installed **************"
exit 0

0 comments on commit f58cc7f

Please sign in to comment.