1515 - name : Checkout code
1616 uses : actions/checkout@v4
1717 with :
18- submodules : recursive
18+ submodules : recursive
19+ token : ${{ secrets.ACTION_TOKEN }}
20+
21+ - name : Get submodule commit hash
22+ id : submodule-hash
23+ run : |
24+ HASH=$(git rev-parse --short HEAD:unitcon-infer)
25+ echo "hash=$HASH" >> $GITHUB_OUTPUT
1926
2027 - name : Install required apt packages
2128 run : |
@@ -28,21 +35,31 @@ jobs:
2835 distribution : ' zulu'
2936 java-version : ' 8'
3037
38+ - name : Cache Infer
39+ id : cache-infer
40+ uses : actions/cache@v4
41+ with :
42+ path : infer.tar
43+ key : infer-tar-${{ steps.submodule-hash.outputs.hash }}
44+ restore-keys : |
45+ infer-tar-${{ steps.submodule-hash.outputs.hash }}
46+ infer-tar-
47+
3148 - name : Set up OCaml
49+ if : steps.cache-infer.outputs.cache-hit != 'true'
3250 uses : ocaml/setup-ocaml@v2
3351 with :
3452 ocaml-compiler : ocaml-variants.4.14.0+options,ocaml-option-flambda
3553
3654 - name : Build Infer
55+ if : steps.cache-infer.outputs.cache-hit != 'true'
3756 shell : bash
3857 run : |
3958 eval $(opam env)
4059 cd unitcon-infer
41- ./build-infer.sh --yes --user-opam-switch java
60+ ./build-infer.sh --yes java
4261 cd ..
43-
44- - name : Tar Infer Artifact
45- run : tar -cf infer.tar unitcon-infer
62+ tar -cf infer.tar unitcon-infer
4663
4764 - name : Upload Infer Artifact
4865 uses : actions/upload-artifact@v4
6380 - env :
6481 OUTPUT1 : ${{ needs.infer-build.outputs.output1 }}
6582 run : echo "Infer artifact-id is $OUTPUT1"
66-
83+
6784 - name : Checkout code
6885 uses : actions/checkout@v4
86+ with :
87+ token : ${{ secrets.ACTION_TOKEN }}
6988
7089 - name : Set up JAVA
7190 uses : actions/setup-java@v4
81100 with :
82101 path : |
83102 ~/.opam
84- ./_opam
85103 key : ${{ env.cache-name }}-build-${{ hashFiles('setup.sh') }}
86104 restore-keys : |
87105 ${{ env.cache-name }}-build-${{ hashFiles('setup.sh') }}
@@ -106,6 +124,7 @@ jobs:
106124 uses : actions/download-artifact@v4
107125 with :
108126 name : infer-artifact
127+ github-token : ${{ secrets.ACTION_TOKEN }}
109128
110129 - name : Untar Infer Artifact
111130 run : tar -xf infer.tar
@@ -118,4 +137,4 @@ jobs:
118137 - name : Run test (regression)
119138 shell : bash
120139 run : |
121- eval $(opam env) && make coverage
140+ eval $(opam env) && make coverage
0 commit comments