-
-
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.
- Loading branch information
1 parent
4fc66c2
commit e2e23e6
Showing
1 changed file
with
57 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,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" |