Skip to content

Commit 033c585

Browse files
Added a new method
1 parent 13b5d62 commit 033c585

File tree

1 file changed

+54
-5
lines changed

1 file changed

+54
-5
lines changed

.github/workflows/infer.yml

+54-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
---
21
name: Infer
32

43
'on':
54
workflow_dispatch:
6-
push:
5+
push:
76
branches:
87
- master
98
pull_request:
@@ -25,7 +24,7 @@ jobs:
2524
with:
2625
ocaml-compiler: 5
2726

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

3130
- name: Cache infer build
@@ -56,5 +55,55 @@ jobs:
5655
- name: Run infer
5756
run: |
5857
mvn clean
59-
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test
60-
...
58+
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test
59+
60+
pr_infer:
61+
runs-on: ubuntu-latest
62+
if: github.event_name == 'pull_request'
63+
needs: run_infer # This ensures the 'run_infer' job completes before 'pr_infer' starts
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up JDK
68+
uses: actions/setup-java@v4
69+
with:
70+
java-version: 21
71+
distribution: 'temurin'
72+
73+
- name: Set up OCaml
74+
uses: ocaml/setup-ocaml@v3
75+
with:
76+
ocaml-compiler: 5
77+
78+
- name: Get current year/week
79+
run: echo "year_week=$(date +'%Y_%U')" >> $GITHUB_ENV
80+
81+
- name: Cache infer build
82+
id: cache-infer
83+
uses: actions/cache@v4
84+
with:
85+
path: infer
86+
key: ${{ runner.os }}-infer-${{ env.year_week }}
87+
88+
- name: Build infer
89+
if: steps.cache-infer.outputs.cache-hit != 'true'
90+
run: |
91+
cd ..
92+
git clone https://github.com/facebook/infer.git
93+
cd infer
94+
./build-infer.sh java
95+
cp -r infer ../Java
96+
97+
- name: Add infer to PATH
98+
run: |
99+
echo "infer/bin" >> $GITHUB_PATH
100+
101+
- name: Display infer version
102+
run: |
103+
which infer
104+
infer --version
105+
106+
- name: Run infer
107+
run: |
108+
mvn clean
109+
infer --fail-on-issue --print-logs --no-progress-bar -- mvn test

0 commit comments

Comments
 (0)