Skip to content

Commit

Permalink
Adding Verita workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sathninduk committed Oct 4, 2024
1 parent 5efc232 commit 046b807
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/verita.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

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: |
git clone https://github.com/sathninduk/Java-Health-System src
cd 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"

0 comments on commit 046b807

Please sign in to comment.