Skip to content

Commit

Permalink
Merge pull request #5 from aman-goel/master
Browse files Browse the repository at this point in the history
Update develop branch with python-app
  • Loading branch information
aman-goel authored Sep 29, 2020
2 parents decaeef + 5b90ff1 commit d26b925
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: avr (single test)
on:
workflow_dispatch:
inputs:
timeout:
description: timeout (in seconds)
default: 300
required: true
file:
description: Benchmark file
default: "examples/btor2/counter.btor2"
required: true
name:
description: Benchmark name
default: "test"
required: true
args:
description: Additional arguments
default: ""
required: false

jobs:
job1:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:saltmakrell/ppa
sudo apt-get update -q
sudo apt-get install yosys
- name: Run file ${{ github.event.inputs.file }} with args ${{ github.event.inputs.args }}
run: |
ENVTIMEOUT=${{ github.event.inputs.timeout }} ./ci/deploy_bm.sh ${{ github.event.inputs.file }} ${{ github.event.inputs.name }} ${{ github.event.inputs.args }}
- name: Upload avr stats
uses: actions/upload-artifact@v2
with:
name: stats.txt
path: output/work_${{ github.event.inputs.name }}/${{ github.event.inputs.name }}.results
if: ${{ always() }}
58 changes: 58 additions & 0 deletions ci/deploy_bm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# Make sure we exit if there is a failure
# set -e

RETURN=1

TIMEOUT=300
if [[ -z "${ENVTIMEOUT}" ]]; then
TIMEOUT=300
else
TIMEOUT=$ENVTIMEOUT
fi

if [ $# -lt 2 ]
then
echo "Usage: <file> <name> <optional-args>"
exit 1
fi

FILE="$1"
shift
NAME="$1"
shift
args=$@

OUTPATH="output"
outFile="$OUTPATH/$NAME.out"
errFile="$OUTPATH/$NAME.err"

python3 avr.py --name $NAME $args $FILE

prFile="$OUTPATH/work_$NAME/result.pr"
if test -f "$prFile"; then
result=$(cat $prFile)
if [ "${result}" == "avr-h" ]; then
echo "Property proved."
RETURN=0
elif [ "${result}" == "avr-v" ]; then
echo "Property violated."
RETURN=0
elif [ "${result}" == "avr-f_to" ]; then
echo "Timeout reached."
elif [ "${result}" == "avr-f_mo" ]; then
echo "Memout reached."
else
echo "Error occurred."
fi
else
echo "Error occurred."
fi

if [ "${RETURN}" == "0" ]; then
echo -e "NO ERROR"
exit 0
else
echo -e "ERROR"
exit 1
fi

0 comments on commit d26b925

Please sign in to comment.