-
Notifications
You must be signed in to change notification settings - Fork 5
133 lines (114 loc) · 4.66 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "check"
check:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: 3.10.0
- name: Python Code Quality and Lint
uses: ricardochaves/python-lint@v1.4.0
with:
use-pylint: false
use-pycodestyle: true
use-flake8: true
use-black: false
use-mypy: false
use-isort: false
extra-flake8-options: "--config .config/pycodestyle/setup.cfg"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel
python3 -m pip install -r scripts/requirements.txt
python3 -m pip install -e ./scripts
- name: Extracting source files from correct YAML files
run: |
python3 -m source_files_extractor tests temp/sources ""
- name: Run Clang-Tidy and save reports to "results" folder
run: |
sudo apt-get update -y
sudo apt-get install -y clang-tidy cmake
python3 -m build_sources temp/sources build
python3 -m clang_tidy -p ./build > results/clang-out.txt
cat results/clang-out.txt
- name: Run Polystat (EO) and save reports to "results" folder
run: |
curl -L -o polystat.jar "https://github.com/polystat/polystat-cli/releases/download/v0.1.11/polystat.jar"
touch results/polystat-eo-out.txt
java -jar polystat.jar eo --in temp/sources/eo --to file=results/polystat-eo-out.txt --sarif
cat results/polystat-eo-out.txt
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run Polystat (Java via J2EO) and save reports to "results" folder
run: |
curl -L -o j2eo.jar "https://search.maven.org/remotecontent?filepath=org/polystat/j2eo/0.5.3/j2eo-0.5.3.jar"
java -jar j2eo.jar temp/sources/java -o temp/sources/j2eo
touch results/polystat-j2eo-out.txt
java -jar polystat.jar eo --in temp/sources/j2eo --to file=results/polystat-j2eo-out.txt --sarif
cat results/polystat-j2eo-out.txt
- name: SVF analysis
run: |
git clone https://github.com/SVF-tools/SVF.git
cd SVF
source ./build.sh
cd ../
python3 -m SVF temp/sources/cpp temp/bc results SVF/Release-build/bin
- name: Cppcheck
run: |
sudo apt-get install -y cppcheck
python3 -m cppcheck temp/sources/cpp results
- name: Spotbugs
run: |
curl -L -o spotbugs-4.7.0.tgz "https://github.com/spotbugs/spotbugs/releases/download/4.7.0/spotbugs-4.7.0.tgz"
gunzip -c spotbugs-4.7.0.tgz | tar xvf -
python3 -m spotbugs spotbugs-4.7.0/lib/spotbugs.jar temp/sources/java results
- name: Analyze reports
run: python3 -m analyze_reports true
# Generate pdf
- uses: yegor256/latexmk-action@0.4.0
with:
cmd: latexmk
path: results/report
opts: report -pdf -shell-escape -f -quiet
packages: href-ul ffcode totpages acmart hyperxmp ifmtarg ncctools
preprint cleveref paralist comment biblatex needspace environ
framed xstring catchfile fvextra libertine inconsolata newtx
# Saving artifacts
- name: Upload results
uses: actions/upload-artifact@v2
with:
name: reports
path: |
results/*.txt
results/report/report.tex
results/report/*.pdf
- name: Save the report to gh-pages branch
run: |
mkdir report
cp results/report/report.pdf report
- uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
branch: gh-pages
folder: report
clean: false