Repository navigation
140 lines (120 loc) · 3.59 KB
/
Copy pathcheck.yml
File metadata and controls
140 lines (120 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: check
on: [push, pull_request]
jobs:
infer-build:
name: infer-build
runs-on: ubuntu-22.04
outputs:
output1: ${{ steps.artifact-infer.outputs.artifact-id }}
permissions:
statuses: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ACTION_TOKEN }}
- name: Get submodule commit hash
id: submodule-hash
run: |
HASH=$(git rev-parse --short HEAD:unitcon-infer)
echo "hash=$HASH" >> $GITHUB_OUTPUT
- name: Install required apt packages
run: |
sudo apt install libmpfr-dev libsqlite3-dev
sudo apt clean
- name: Set up JAVA
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Cache Infer
id: cache-infer
uses: actions/cache@v4
with:
path: infer.tar
key: infer-tar-${{ steps.submodule-hash.outputs.hash }}
restore-keys: |
infer-tar-${{ steps.submodule-hash.outputs.hash }}
infer-tar-
- name: Set up OCaml
if: steps.cache-infer.outputs.cache-hit != 'true'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-variants.4.14.0+options,ocaml-option-flambda
- name: Build Infer
if: steps.cache-infer.outputs.cache-hit != 'true'
shell: bash
run: |
eval $(opam env)
cd unitcon-infer
./build-infer.sh --yes java
cd ..
tar -cf infer.tar unitcon-infer
- name: Upload Infer Artifact
uses: actions/upload-artifact@v4
id: artifact-infer
with:
name: infer-artifact
path: infer.tar
retention-days: 1
unitcon-build:
name: unitcon-build
runs-on: ubuntu-22.04
needs: infer-build
permissions:
statuses: write
contents: read
steps:
- env:
OUTPUT1: ${{ needs.infer-build.outputs.output1 }}
run: echo "Infer artifact-id is $OUTPUT1"
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
- name: Set up JAVA
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Use cached dependencies
id: cache-unitcon-opam
uses: actions/cache@v4
env:
cache-name: cache-unitcon-opam
with:
path: |
~/.opam
key: ${{ env.cache-name }}-build-${{ hashFiles('setup.sh') }}
restore-keys: |
${{ env.cache-name }}-build-${{ hashFiles('setup.sh') }}
${{ env.cache-name }}-build-
- name: Set up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-variants.4.14.0+options,ocaml-option-flambda
- name: Install ocamlformat
shell: bash
run: opam install ocamlformat.0.26.1
- name: Check format
shell: bash
run: |
eval $(opam env)
make fmt
- name: Download Infer Artifact
uses: actions/download-artifact@v4
with:
name: infer-artifact
github-token: ${{ secrets.ACTION_TOKEN }}
- name: Untar Infer Artifact
run: tar -xf infer.tar
- name: Build Unitcon
shell: bash
run: |
./setup.sh unitcon || { eval $(opam env) && make -j; }
- name: Run test (regression)
shell: bash
run: |
eval $(opam env) && make coverage