chore: add run_infer.yml
#16
Workflow file for this run
This file contains hidden or 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
--- | |
name: run_infer | |
'on': | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
run_infer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'adopt' | |
- name: Set up OCaml | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: 5 | |
- name: Clone infer | |
run: | | |
cd ../ | |
git clone https://github.com/facebook/infer.git | |
- name: Compute infer hash | |
run: | | |
git rev-parse HEAD > infer_hash.sha512 | |
cat infer_hash.sha512 | |
- name: Cache infer build | |
id: cache-infer | |
uses: actions/cache@v4 | |
with: | |
path: ../infer | |
key: ${{ runner.os }}-infer-${{ hashFiles('./infer_hash.sha512') }} | |
- name: Build infer | |
if: steps.cache-infer.outputs.cache-hit != 'true' | |
run: | | |
cd ../infer | |
./build-infer.sh java | |
- name: Add infer to PATH | |
run: | | |
echo "../infer/infer/bin" >> $GITHUB_PATH | |
- name: Display infer version | |
run: | | |
which infer | |
infer --version | |
- name: Run infer | |
run: | | |
mvn clean | |
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test | |
... |