forked from polystat/far
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
polystat#35 - added github actions workflow for find division by zero…
… errors
- Loading branch information
Showing
3 changed files
with
45 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,34 @@ | ||
name: С++ division by zero validation | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Pull the Docker image | ||
run: | | ||
mkdir out | ||
docker pull yegor256/c2eo:0.1.24 | ||
- name: Run the Docker image | ||
run: docker run -v $(pwd):/eo yegor256/c2eo:0.1.24 examples/hello.c out/global.eo | ||
- name: Check out/global.eo | ||
run: cat out/global.eo | ||
- name: Run Polystat Jar | ||
run: bash polystat.sh | ||
- name: Check polystat-eo-out.txt | ||
run: cat polystat-eo-out.txt | ||
- name: Upload results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: polystat-eo-out | ||
path: polystat-eo-out.txt |
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,3 @@ | ||
auto test(int a, int b) -> int { | ||
return (a / b) + ((b / a) / a); | ||
} |
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,8 @@ | ||
#!/bin/bash | ||
|
||
# Run Polystat (EO) and save reports to "results" folder | ||
curl -L -o polystat.jar "https://github.com/polystat/polystat-cli/releases/download/v0.1.11/polystat.jar" | ||
echo "Polystat (EO) analysis has started" | ||
touch polystat-eo-out.txt | ||
java -jar polystat.jar eo --in out --to file=polystat-eo-out.txt --sarif | ||
echo "Polystat (EO) analysis has finished"o polystat.jar "https://github.com/polystat/polystat-cli/releases/download/v0.1.11/polystat.jar" |