Skip to content

Adding smoke test to xcfa-cli #357

Adding smoke test to xcfa-cli

Adding smoke test to xcfa-cli #357

name: Linux build-test-deploy
on:
push:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
message:
description: 'Summarize the contents since the last version'
required: true
default: 'Auto-generated release'
permissions: write-all
concurrency:
group: deploy-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Build
uses: ./.github/actions/build-action
- name: Upload JARs
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: ThetaJars
path: subprojects/**/*-all.jar
- name: Positive outcome badge
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} build"
status: "Success"
color: "green"
path: "badges/build-${{ runner.os }}"
- name: Negative outcome badge
if: ${{ failure() }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} build"
status: "Failure"
color: "red"
path: "badges/build-${{ runner.os }}"
test-benchexec:
strategy:
matrix:
task: [ReachSafety-Arrays, ReachSafety-BitVectors, ReachSafety-ControlFlow, ReachSafety-ECA, ReachSafety-Floats, ReachSafety-Heap, ReachSafety-Loops, ReachSafety-ProductLines, ReachSafety-Recursive, ReachSafety-Sequentialized, ReachSafety-XCSP, ReachSafety-Combinations, ReachSafety-Hardware, ConcurrencySafety-Main, NoDataRace-Main, ConcurrencySafety-NoOverflows, ConcurrencySafety-MemSafety]
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install benchexec and dependencies
run: |
sudo add-apt-repository ppa:sosy-lab/benchmarking
sudo apt install benchexec openjdk-17-jre-headless libgomp1 libmpfr-dev
- name: Get benchmark definition file
run: |
mkdir -p xml
wget https://gitlab.com/sosy-lab/sv-comp/bench-defs/-/raw/main/benchmark-defs/theta.xml -P xml
sed -i 's/<benchmark tool="theta" timelimit="990 s" hardtimelimit="1050 s" memlimit="15 GB" cpuCores="4">/<benchmark tool="theta" timelimit="60 s" hardtimelimit="90 s">/g' xml/theta.xml
- name: Get sv-benchmarks
run: |
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks.git
cd sv-benchmarks
git sparse-checkout add c
git checkout
- name: Get archive
run: |
wget https://github.com/ftsrg/theta/releases/download/svcomp23/theta.zip
unzip theta.zip
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
name: Get JAR
with:
name: ThetaJars
path: jar/
- name: Add new jar to archive
run: |
mv jar/xcfa/xcfa-cli/build/libs/*-all.jar theta/theta.jar
ls -l theta
- name: Cut setfile if too long
run: |
cd sv-benchmarks/c
for i in $(sed 's/#.*$//g' ${{ matrix.task }}.set); do find . -wholename ./$i; done | while read line; do echo $(echo $line | sha1sum | awk ' { print $1 } ') $line ; done | sort -k1 | awk ' { $1=""; print $0 } ' | awk '{$1=$1};1' > all-files.txt
head -n25 all-files.txt > ${{ matrix.task }}.set
- name: Run benchexec
run: |
benchexec xml/theta.xml --no-container --tool-directory theta -t ${{ matrix.task }}
- name: Upload results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: BenchexecResults-${{ matrix.task }}
path: results
collect-results:
needs: test-benchexec
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install benchexec
run: |
sudo add-apt-repository ppa:sosy-lab/benchmarking
sudo apt install benchexec
- name: Download artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
path: artifacts
- name: Generate tables
id: generate
run: |
cd artifacts
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "Message<<$EOF" >> $GITHUB_OUTPUT
for i in *
do
pushd $i
if (ls *.txt >/dev/null 2>/dev/null)
then
table-generator -d *xml.bz2
sed -i 's/\.\.\/sv-benchmarks/https:\/\/gitlab\.com\/sosy-lab\/benchmarking\/sv-benchmarks\/-\/raw\/main/g' *.html
unzip *.zip
echo "<details><summary>${i#BenchexecResults-}</summary>" >> $GITHUB_OUTPUT
tail -n9 *.txt >> $GITHUB_OUTPUT
echo "</details>" >> $GITHUB_OUTPUT
echo >> $GITHUB_OUTPUT
echo >> $GITHUB_OUTPUT
fi
popd
done
echo "$EOF" >> $GITHUB_OUTPUT
- name: Upload results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: BenchexecResults-${{ matrix.task }}
path: results
- name: See PR message
run: |
echo "${{ steps.generate.outputs.Message }}"
- name: Comment on PR
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@dadb7667129e23f12ca3925c90dc5cd7121ab57e
with:
comment_tag: 'diffcheck'
mode: 'recreate'
message: |
Benchexec test report for a selection of SV-Benchmarks:
${{ steps.generate.outputs.Message }}
javadoc:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Deploy javadoc to github-pages
uses: ./.github/actions/deploy-javadoc
test-linux:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04]
needs: build
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install LLVM and Clang
uses: ./.github/actions/install-llvm
with:
version: "15"
- name: Run tests
uses: ./.github/actions/test-action
- name: Positive outcome badge
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} test"
status: "Success"
color: "green"
path: "badges/test-${{ runner.os }}"
- name: Negative outcome badge
if: ${{ failure() && matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} test"
status: "Failure"
color: "red"
path: "badges/test-${{ runner.os }}"
deploy-release:
needs: test-linux
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Create release and deploy JARs
uses: ./.github/actions/create-release
with:
message: ${{ inputs.message }}
deploy-maven:
needs: test-linux
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Create and publish maven release
uses: ./.github/actions/deploy-maven
with:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_PWD: ${{ secrets.PGP_PWD }}
test-docker:
strategy:
matrix:
dockerprojects: ["theta-cfa-cli", "theta-sts-cli", "theta-xsts-cli", "theta-xta-cli"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Version
id: version
run: |
echo version=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') >> $GITHUB_OUTPUT
- name: docker-login
uses: ./.github/actions/docker-login
with:
username: ${{secrets.DOCKER_USERNAME}}
token: ${{secrets.DOCKER_TOKEN}}
- name: docker-login-ghcr
uses: ./.github/actions/docker-login
with:
registry: ghcr.io
username: ${{github.repository_owner}}
token: ${{secrets.GITHUB_TOKEN}}
- name: Build and publish docker file
uses: ./.github/actions/docker-deploy
with:
project: ${{ matrix.dockerprojects }}
version: ${{ steps.version.outputs.version }}
user-dockerhub: ftsrg
user-ghcr: ftsrg
push: false
deploy-docker:
needs: [test-linux, test-docker]
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
strategy:
matrix:
dockerprojects: ["theta-cfa-cli", "theta-sts-cli", "theta-xsts-cli", "theta-xta-cli"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Version
id: version
run: |
echo version=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') >> $GITHUB_OUTPUT
- name: docker-login
uses: ./.github/actions/docker-login
with:
username: ${{secrets.DOCKER_USERNAME}}
token: ${{secrets.DOCKER_TOKEN}}
- name: docker-login-ghcr
uses: ./.github/actions/docker-login
with:
registry: ghcr.io
username: ${{github.repository_owner}}
token: ${{secrets.GITHUB_TOKEN}}
- name: Build and publish docker file
uses: ./.github/actions/docker-deploy
with:
project: ${{ matrix.dockerprojects }}
version: ${{ steps.version.outputs.version }}
user-dockerhub: ftsrg
user-ghcr: ftsrg
push: true
- name: Docker Hub Description update
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: ftsrg/${{ matrix.dockerprojects }}
deploy-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Deploy docs
uses: ./.github/actions/deploy-docs