-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.98 KB
/
verita_formal.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
name: Verita - Formal Specification
on:
push:
branches:
- main # Run on main branch
pull_request:
types: [opened, synchronize, reopened]
jobs:
openjml:
name: Run OpenJML
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Download OpenJML
run: |
sudo wget https://github.com/OpenJML/OpenJML/releases/download/0.21.0-alpha-0/openjml-ubuntu-22.04-0.21.0-alpha-0.zip -O /openjml-ubuntu-22.04-0.21.0-alpha-0.zip
sudo unzip /openjml-ubuntu-22.04-0.21.0-alpha-0.zip -d /OpenJML-0.21.0-alpha-0
- name: Verify OpenJML installation
run: |
echo $PATH
/OpenJML-0.21.0-alpha-0/openjml -version
- name: clone git repo
run: |
REPO_URL="https://github.com/${GITHUB_REPOSITORY}.git"
git clone $REPO_URL repo_src
cd repo_src
- name: Identify Latest Changes
run: |
git log --name-only --pretty="" -n 1
- name: Run OpenJML and save logs
run: |
shopt -s globstar
/OpenJML-0.21.0-alpha-0/openjml -esc -progress ./src/**/*.java ./src/*.java 2>&1 | tee openjml.log
echo "Logs have been saved to $(pwd)/openjml.log"
- name: Send OpenJML logs to verita
run: |
REPO_NAME=$(echo $GITHUB_REPOSITORY)
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
COMMIT_ID=$(git rev-parse --short HEAD)
FILE_NAME="log_${GITHUB_REPOSITORY//\//_}_${BRANCH_NAME}_${COMMIT_ID}.log"
sudo curl --location 'https://verita-logger-api.dpacks.net' \
--header 'x-api-key: 248frv384' \
--form "filename=${FILE_NAME}" \
--form "repository=${REPO_NAME}" \
--form "branch=main" \
--form "commit_id=${COMMIT_ID}" \
--form "file=@$(pwd)/openjml.log"