-
Notifications
You must be signed in to change notification settings - Fork 2k
157 lines (131 loc) · 5.37 KB
/
install.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: build
on:
- push
- pull_request
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload-url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Create Release
id: create-release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Infer version ${{ github.ref }}
draft: true
prerelease: false
body: |
BEFORE PUBLISHING CHECKLIST:
1. From the commit tagged on GitHub, create and push a new version of the website with "make new-website-version" (see website/README.md for how to test).
2. Consider deleting the oldest documentation version (see Docusaurus 2 documentation for details).
3. Fill in the changelog below to go on GitHub.
4. Download the release tarballs and test that the binaries works.
5. Fill in the shasums by running the command at the end of the release text.
--- PUBLISH GITHUB RELEASE HERE ---
6. At some point, copy the GitHub changelog to Changelog.md in the repo.
7. Tweet.
--- DELETE EVERYTHING ABOVE THIS LINE ---
This is a binary release of Infer for Linux and MacOS. To use it follow these [instructions](http://fbinfer.com/docs/getting-started).
- new feature 1
- new feature 2
The sha256 checksums of the tarballs are:
```
$ shasum -a 256 infer-*-v<VERSION GOES HERE>.tar.xz
DOWNLOAD BOTH TARBALLS AND PUT RESULT OF THE ABOVE COMMAND HERE BEFORE PUBLISHING
```
build:
name: Build Infer
needs: create-release
strategy:
fail-fast: false
matrix:
os:
- macOS-latest
- macOS-13
- ubuntu-latest
ocaml-compiler:
- ocaml-variants.4.14.0+options,ocaml-option-flambda
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Required Apt Packages for Ubuntu
run: |
sudo apt install clang libmpfr-dev libsqlite3-dev ninja-build
sudo apt clean
if: runner.os == 'Linux'
- name: Install Required Brew Packages for MacOS
run: brew install automake jq ninja pkg-config lzlib zlib coreutils
if: runner.os == 'macOS'
- name: Setup Java SDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Get OS version
uses: sersoft-gmbh/os-version-action@v1
id: os-version
- name: Force the use of test dependencies
run: cp opam/infer-tests.opam.locked opam/infer.opam.locked
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Compute hash of clang installation
id: clang-hash
run: |
echo "value=$(./facebook-clang-plugins/clang/setup.sh --clang-hash)" >> $GITHUB_OUTPUT
- name: Attempt to get clang from the cache
id: cache-clang
uses: actions/cache@v4
with:
path: facebook-clang-plugins/clang/install
key: clang-${{ runner.os }}-${{ runner.arch }}-${{ steps.clang-hash.outputs.value }}
- name: Record that the clang cache was hit
if: steps.cache-clang.outputs.cache-hit == 'true'
run: ./facebook-clang-plugins/clang/setup.sh --only-record-install
- name: Build clang on cache misses
if: steps.cache-clang.outputs.cache-hit != 'true'
run: |
./facebook-clang-plugins/clang/src/prepare_clang_src.sh
CC=clang CXX=clang++ ./facebook-clang-plugins/clang/setup.sh --ninja --sequential-link
- if: runner.os == 'Linux'
run: ./build-infer.sh --yes --user-opam-switch
- if: runner.os == 'macOS'
run: ./build-infer.sh --yes --user-opam-switch -- --disable-python-analyzers
- name: Install ocamlformat
run: |
opam install --deps-only --locked opam/ocamlformat.opam.locked
opam install ocamlformat.$(grep -e '^version:' ./opam/ocamlformat.opam.locked | cut -d ' ' -f 2 | tr -d \")
opam exec -- ocamlformat --version
- name: Test infer
run: make test -k NDKBUILD=no
- run: |
sudo make install BUILD_MODE=opt
# restore permissions after root build
sudo chown -R $USER: .
- name: Build release tarball
id: build-release
if: startsWith(github.ref, 'refs/tags/v')
run: |
./scripts/create_binary_release.sh "$(echo '${{ github.ref }}' | rev | cut -d / -f 1 | rev)"
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload-url }}
asset_path: ${{ steps.build-release.outputs.tarball-path }}
asset_name: ${{ steps.build-release.outputs.tarball-path }}
asset_content_type: application/x-gtar