-
Notifications
You must be signed in to change notification settings - Fork 44
200 lines (165 loc) · 7.03 KB
/
ci.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
name: CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
LOCAL_BIN: ${{ github.workspace }}/.local/bin
jobs:
ci:
strategy:
fail-fast: false
matrix:
ghc: [8.6.5, 8.8.4, 8.10.7]
compiler: [gcc]
include:
- ghc: 8.10.7
compiler: clang
runs-on: 32-core-ubuntu
container:
image: ubuntu:24.04
options: --security-opt=seccomp=unconfined
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Initialize APT
run: |
apt-get update
apt-get install -y curl
- name: Setup en_US.UTF-8 locale
run: |
apt-get install -y locales
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
- name: Setup LOCAL_BIN environment
run: |
mkdir -p "$LOCAL_BIN"
echo "$LOCAL_BIN" >> "$GITHUB_PATH"
- name: Setup build time flags
run: |
echo "MAKEFLAGS=-j$(nproc)" >> "$GITHUB_ENV"
echo "EXTRA_GHC_OPTS=-j$(nproc) +RTS -A128m -n2m -RTS" >> "$GITHUB_ENV"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install indexer (python)
run: |
apt-get install -y python3-pip
npm install -g @sourcegraph/scip-python
- name: Install indexer (flow)
run: npm install -g flow-bin
- name: Install indexer (typescript)
run: npm install -g @sourcegraph/scip-typescript
- name: Install .NET Framework dependencies
run: apt-get install -y libicu74
- name: Setup .NET Framework
uses: actions/setup-dotnet@v4
env:
DOTNET_INSTALL_DIR: ${{ env.LOCAL_BIN }}
with:
dotnet-version: 7.0.x # Required by `scip-dotnet`.
- name: Install indexer (dotnet)
run: dotnet tool install --tool-path $LOCAL_BIN scip-dotnet
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Install indexer (go)
run: go install github.com/sourcegraph/scip-go/cmd/scip-go@latest
- name: Install indexer (hack)
run: |
# From https://hhvm.com/blog/2022/08/30/experimenting-with-universal-deb-packages.html
apt-get install -y software-properties-common apt-transport-https
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
add-apt-repository 'deb https://dl.hhvm.com/universal nightly main'
apt-get update
apt-get install -y hhvm
- name: Install indexer (java)
run: |
apt-get install -y default-jdk maven
curl -fLo coursier https://git.io/coursier-cli && chmod +x coursier
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
./coursier bootstrap --standalone -o "$LOCAL_BIN"/lsif-java com.sourcegraph:lsif-java_2.13:0.8.0-RC1 --main-class com.sourcegraph.lsif_java.LsifJava
- name: Install indexer (rust)
run: |
export RUST_ANALYZER=2023-11-06
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
curl -L https://github.com/rust-analyzer/rust-analyzer/releases/download/${RUST_ANALYZER}/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > "$LOCAL_BIN"/rust-analyzer
chmod +x "$LOCAL_BIN"/rust-analyzer
- name: Setup Haskell
run: |
curl --proto '=https' --tlsv1.2 -sSf "https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup" -o "$LOCAL_BIN"/ghcup
chmod +x "$LOCAL_BIN"/ghcup
ghcup install cabal --set
apt-get install -y build-essential libgmp-dev libnuma-dev
ghcup install ghc ${{ matrix.ghc }} --set
echo "$HOME/.ghcup/bin" >> "$GITHUB_PATH"
# This needs to be before the Clang step since they install GCC. We want to remove GCC if Clang is enabled.
- name: Install CMake and Boost
run : apt-get install -y cmake libboost-all-dev
- if: matrix.compiler == 'clang'
name: Setup Clang
run: |
export VER=15
apt-get install -y clang-$VER
apt-get remove -y gcc g++
apt-get autoremove -y
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$VER 10
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$VER 10
# needed for `ghc`, it actually invokes `gcc` explicitly.
update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-$VER 10
# needed for `hsc2hs`, `g++` is hardcoded into `hsc2hs-options`.
update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-$VER 10
echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -fclang" >>"$GITHUB_ENV"
- name: Install folly and rocksdb dependencies
run: |
apt-get install -y git ninja-build \
libaio-dev libbz2-dev libdouble-conversion-dev libdwarf-dev libgoogle-glog-dev libiberty-dev libjemalloc-dev \
liblzma-dev liblz4-dev libsnappy-dev libsodium-dev libssl-dev libunwind-dev libzstd-dev libfast-float-dev
- name: Fetch hsthrift and build folly, rocksdb
run: ./install_deps.sh --threads $(nproc)
- name: Nuke build artifacts
run: rm -rf /tmp/fbcode_builder_getdeps-Z__wZGleanZGleanZhsthriftZbuildZfbcode_builder-root/
- name: Setup hsthrift environment
run: |
echo "LD_LIBRARY_PATH=$HOME/.hsthrift/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$HOME/.hsthrift/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
echo "$HOME/.hsthrift/bin" >> "$GITHUB_PATH"
- name: Populate hackage index
run: cabal update
- name: Disable some tests
run: echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-hack-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"
- name: Install hsthrift and Glean dependencies
run: apt-get install -y pkg-config rsync libgmock-dev libpcre3-dev libtinfo-dev libxxhash-dev
- name: Build hsthrift and Glean
run: make
- name: Build glass
run: make glass
- name: Install glean-clang dependencies
run: apt-get install -y clang-15 libclang-15-dev libclang-cpp15-dev libre2-dev
- name: Build glean-clang
run: make glean-clang
- if: matrix.ghc != '8.6.5'
name: Build hiedb-indexer
run: make glean-hiedb
- name: Run tests
run: make test
# check the vscode extension builds
vscode:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Build VS Code Extension
run: npx vsce package
working-directory: glean/vscode
- name: Archive .vsix extension file
uses: actions/upload-artifact@v4
with:
name: glean-vsix
path: |
glean/vscode/*.vsix