-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from aman-goel/master
Update develop branch with python-app
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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
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() }} |
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
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 |