-
Notifications
You must be signed in to change notification settings - Fork 38
186 lines (159 loc) · 5.6 KB
/
Copy pathci-getdeps.yml
File metadata and controls
186 lines (159 loc) · 5.6 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
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
name: CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
LOCAL_BIN: ${{ github.workspace }}/.local/bin
jobs:
ci-getdeps:
strategy:
fail-fast: false
matrix:
ghc: [8.6.5, 8.8.4, 8.10.7, 9.2.8, 9.4.7, 9.6.6, 9.8.2]
buildtype: [getdeps]
include:
- ghc: 9.4.7
buildtype: cabal
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
options: --security-opt=seccomp=unconfined
env:
LD_LIBRARY_PATH: "/github/home/.hsthrift/lib"
PKG_CONFIG_PATH: "/github/home/.hsthrift/lib/pkgconfig"
steps:
- name: Checkout code
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: Env
run: env
- if: matrix.buildtype == 'getdeps'
name: Drop system libfmt
run: apt-get remove -y libfmt-dev
- name: Install required packages
run : >-
apt-get install -y
g++
cmake
make
ninja-build
bison
flex
git
curl
rsync
m4
libzstd-dev
libboost-all-dev
libevent-dev
libdouble-conversion-dev
libgoogle-glog-dev
libgflags-dev
libiberty-dev
liblz4-dev
liblzma-dev
libsnappy-dev
zlib1g-dev
binutils-dev
libjemalloc-dev
libssl-dev
pkg-config
libunwind-dev
libsodium-dev
libpcre3-dev
libfftw3-dev
libxxhash-dev
libgtest-dev
libtinfo-dev
libaio-dev
libgmock-dev
libbenchmark-dev
- 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"
- if: matrix.buildtype == 'getdeps'
name: Setup PACKAGES
run: |
echo "BUILD_PACKAGES=folly-clib fb-util fb-stubs mangle thrift-lib thrift-server thrift-compiler thrift-tests thrift-haxl thrift-cpp-channel thrift-http" >> "$GITHUB_ENV"
echo "TEST_PACKAGES=fb-util mangle thrift-lib thrift-server thrift-compiler thrift-tests thrift-http" >> "$GITHUB_ENV"
- if: matrix.buildtype == 'cabal'
name: Setup PACKAGES
run: |
echo "BUILD_PACKAGES=folly-clib fb-util fb-stubs mangle thrift-lib thrift-compiler thrift-haxl thrift-http" >> "$GITHUB_ENV"
echo "TEST_PACKAGES=fb-util mangle thrift-lib thrift-compiler thrift-http" >> "$GITHUB_ENV"
- if: matrix.buildtype == 'getdeps'
name: Cache C++ dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ~/.hsthrift
key: hsthrift-deps-${{ runner.os }}-${{ hashFiles('build/deps/github_hashes/**', 'build/fbcode_builder/manifests/fmt', 'build/fbcode_builder/manifests/fast_float', 'new_install_deps.sh', 'build.sh') }}
- if: matrix.buildtype == 'getdeps' && steps.cache-deps.outputs.cache-hit != 'true'
name: Install folly, fizz, wangle, fbthrift
run: ./new_install_deps.sh
- if: matrix.buildtype == 'getdeps'
name: Add fbthrift/thrift1 to PATH
run: echo "$HOME/.hsthrift/bin" >> "$GITHUB_PATH"
- if: matrix.buildtype == 'getdeps'
name: Set Cabal flags
run: |
echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-bundled-folly" >>"$GITHUB_ENV"
- if: matrix.buildtype == 'cabal'
name: Set Cabal flags
run: |
echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-fbthrift" >>"$GITHUB_ENV"
- if: matrix.buildtype == 'cabal'
name: Install dependencies needed by the Cabal build
run: |
apt-get install -y libfmt-dev
- name: Grab folly sources
run: |
apt-get install -y libfast-float-dev wget
make setup-folly
make setup-folly-version
- name: Setup cabal.project
run: |
ln -s cabal-github.project cabal.project
- name: Populate hackage index
run: cabal update
- if: matrix.buildtype == 'getdeps'
name: Generate C++ code from thrift files
run: make thrift-cpp
- name: Build everything up to thrift-compiler
run: cabal $CABAL_CONFIG_FLAGS build exe:thrift-compiler
- name: Generate Haskell code from thrift files
run: make thrift-hs
- name: Generate source distributions for all packages
run: |
cabal sdist $BUILD_PACKAGES
- name: Unpack source distributions in new directory
run: |
mkdir _sdists
cd _sdists
for f in $(ls ../dist-newstyle/sdist/*.tar.gz); do
tar xzf $f;
done
cp ../ci-sdist.cabal.project cabal.project
cd ..
- name: Build all packages
run: cabal $CABAL_CONFIG_FLAGS build $BUILD_PACKAGES
working-directory: ./_sdists
- name: Run testsuites
run: cabal $CABAL_CONFIG_FLAGS test $TEST_PACKAGES --keep-going
working-directory: ./_sdists