Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# This file is part of JavaSMT,
# an API wrapper for a collection of SMT solvers:
# https://github.com/sosy-lab/java-smt
#
# SPDX-FileCopyrightText: 2026 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linux:
name: Linux (Java ${{ matrix.java }})
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Cache Ivy and Ant
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache
~/.ant/lib
key: linux-ivy-${{ hashFiles('build.xml', 'lib/ivy.xml', 'build/build-ivy.xml') }}
restore-keys: |
linux-ivy-

- name: Install Ant
run: |
sudo apt-get update
sudo apt-get install -y ant

- name: Build dependencies
run: ant build-dependencies

- name: Build project
run: ant build

- name: Run tests
run: ant unit-tests

- name: Archive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-results-linux-java${{ matrix.java }}
path: |
junit/TEST-*.xml
JUnit.html
hs_err_pid*.log
replay_pid*.log

macos:
name: macOS (Java ${{ matrix.java }})
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Cache Ivy and Ant
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache
~/.ant/lib
key: macos-ivy-${{ hashFiles('build.xml', 'lib/ivy.xml', 'build/build-ivy.xml') }}
restore-keys: |
macos-ivy-

- name: Install Ant
run: brew install ant

- name: Build dependencies
run: ant build-dependencies

- name: Build project
run: ant build

- name: Prepare native libraries
run: |
mkdir -p lib/native/arm64-macosx/
find lib/java -name "*.dylib" -exec cp {} lib/native/arm64-macosx/ \;

- name: Run tests
run: ant unit-tests

- name: Archive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-results-macos-java${{ matrix.java }}
path: |
junit/TEST-*.xml
JUnit.html
hs_err_pid*.log
replay_pid*.log

windows:
name: Windows (Java ${{ matrix.java }})
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Cache Ivy and Ant
uses: actions/cache@v4
with:
path: |
C:\Users\runneradmin\.ivy2\cache
C:\Users\runneradmin\.ant\lib
key: windows-ivy-${{ hashFiles('build.xml', 'lib/ivy.xml', 'build/build-ivy.xml') }}
restore-keys: |
windows-ivy-

- name: Install Ant
run: choco install ant -y

- name: Build dependencies
run: ant build-dependencies

- name: Build project
run: ant build

- name: Prepare native libraries
shell: pwsh
run: |
Get-ChildItem -Path "lib/java" -Filter "*.dll" -Recurse | Copy-Item -Destination "lib/native/x86_64-windows/" -Force

- name: Run tests
run: ant unit-tests

- name: Archive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-results-windows-java${{ matrix.java }}
path: |
junit/TEST-*.xml
JUnit.html
hs_err_pid*.log
replay_pid*.log
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ build.properties
/downloads

pom.xml

# Local SSD Setup
.tools/
.caches/
env.sh
7 changes: 4 additions & 3 deletions src/org/sosy_lab/java_smt/test/SolverContextFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ private boolean isSupportedOperatingSystemAndArchitecture() {
return IS_LINUX && !IS_ARCH_ARM64;
case CVC5:
return (IS_LINUX && isSufficientVersionOfLibcxx("cvc5jni"))
|| (IS_WINDOWS && !IS_ARCH_ARM64);
|| (IS_WINDOWS && !IS_ARCH_ARM64)
|| IS_MAC;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The better fix would be to generally allow Windows on arm64, because we provide already the dependency (dll) for that. We just have no CI for testing it. I had provided the exact screenshot for that.

case OPENSMT:
return IS_LINUX && isSufficientVersionOfLibcxx("opensmtj");
case BITWUZLA:
Expand Down Expand Up @@ -231,8 +232,8 @@ private void checkVersion(SolverContext pContext) {
solverName = "Z3";
}
String optionalSuffix = "([A-Za-z0-9.,:_+\\-\\s()@]+)?"; // any string
String versionNumberRegex =
"(version\\s)?\\d+\\.\\d+(\\.\\d+)?(\\.\\d+)?"; // 2-4 numbers with dots
String versionNumberRegex = "(version\\s)?\\d+\\.\\d+(\\.\\d+)?(\\.\\d+)?"; // 2-4 numbers with
// dots
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated to this PR.

if (solverToUse() == Solvers.PRINCESS) {
versionNumberRegex = "\\d+-\\d+-\\d+"; // Princess uses date instead of version
}
Expand Down
Loading