Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 54 additions & 5 deletions .github/workflows/infer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: Infer

'on':
workflow_dispatch:
push:
push:
branches:
- master
pull_request:
Expand All @@ -25,7 +24,7 @@ jobs:
with:
ocaml-compiler: 5

- name: Get current year/weak
- name: Get current year/week
run: echo "year_week=$(date +'%Y_%U')" >> $GITHUB_ENV

- name: Cache infer build
Expand Down Expand Up @@ -56,5 +55,55 @@ jobs:
- name: Run infer
run: |
mvn clean
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test
...
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test

pr_infer:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: run_infer # This ensures the 'run_infer' job completes before 'pr_infer' starts
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Set up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5

- name: Get current year/week
run: echo "year_week=$(date +'%Y_%U')" >> $GITHUB_ENV

- name: Cache infer build
id: cache-infer
uses: actions/cache@v4
with:
path: infer
key: ${{ runner.os }}-infer-${{ env.year_week }}

- name: Build infer
if: steps.cache-infer.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/facebook/infer.git
cd infer
./build-infer.sh java
cp -r infer ../Java

- name: Add infer to PATH
run: |
echo "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
Loading