-
Notifications
You must be signed in to change notification settings - Fork 5
125 lines (122 loc) · 4.66 KB
/
ci.yml
File metadata and controls
125 lines (122 loc) · 4.66 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- otp: "25"
fdb: "7.2.2"
eunit: true
- otp: "25"
fdb: "7.3.62"
eunit: true
- otp: "27.0.1"
fdb: "7.2.2"
eunit: true
- otp: "27.0.1"
fdb: "7.3.62"
eunit: true
bindingtester: true
dialyzer: true
fmt: true
name: "linux / OTP ${{ matrix.otp }} / FDB ${{ matrix.fdb }} (${{ matrix.eunit && 'eunit' || '' }}${{ matrix.bindingtester && ' bindingtester' || '' }}${{ matrix.dialyzer && ' dialyzer' || '' }}${{ matrix.fmt && ' fmt' || '' }})"
env:
FDB_VERSION: ${{ matrix.fdb }}
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: "3.24.0"
- name: Run rebar3 fmt check for Erlang files
run: ERLFDB_ASSERT_API_VERSION=0 rebar3 fmt --check
if: ${{ matrix.fmt }}
- name: Run clang-format check for C files
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: "18"
check-path: c_src
if: ${{ matrix.fmt }}
- name: Install FoundationDB
run: |
wget https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-server_${FDB_VERSION}-1_amd64.deb
sudo dpkg -i foundationdb-clients_${FDB_VERSION}-1_amd64.deb
sudo dpkg -i foundationdb-server_${FDB_VERSION}-1_amd64.deb
fdbcli --exec 'configure tenant_mode=optional_experimental'
if: ${{ matrix.dialyzer || matrix.eunit || matrix.bindingtester }}
- name: Run dialyzer
run: rebar3 dialyzer
if: ${{ matrix.dialyzer }}
- name: EUnit tests
run: rebar3 eunit
if: ${{ matrix.eunit }}
- name: Binding Tester
env:
ERL_LIBS: _build/test/lib/erlfdb/
run: |
curl -L "https://github.com/apple/foundationdb/archive/${{ env.FDB_VERSION }}.tar.gz" > foundation.tar.gz
tar -xf foundation.tar.gz
rm foundation.tar.gz
mv foundationdb-$FDB_VERSION foundationdb
cd foundationdb
sed "s:USER_SITE_PATH:$(python3 -m site --user-site):g" ../test/bindingtester/foundationdb.patch | patch -p1
cd ..
pip3 install --user -Iv foundationdb==${{ env.FDB_VERSION }}
pip3 show foundationdb
./test/bindingtester/loop.sh
if: ${{ matrix.bindingtester }}
multiversion:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- otp: "27.0.1"
fdb_old: "7.2.2"
fdb_new: "7.3.62"
name: "linux / OTP ${{ matrix.otp }} / FDB ${{ matrix.fdb_old }} -> ${{ matrix.fdb_new }} (multiversion)"
env:
FDB_OLD: ${{ matrix.fdb_old }}
FDB_NEW: ${{ matrix.fdb_new }}
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: "3.24.0"
- name: Download FDB packages
run: |
wget https://github.com/apple/foundationdb/releases/download/${FDB_OLD}/foundationdb-clients_${FDB_OLD}-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/${FDB_OLD}/foundationdb-server_${FDB_OLD}-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/${FDB_NEW}/foundationdb-clients_${FDB_NEW}-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/${FDB_NEW}/foundationdb-server_${FDB_NEW}-1_amd64.deb
- name: Run multiversion upgrade test
run: bash test/multiversion/run_upgrade_test.sh
macos:
runs-on: macos-latest
strategy:
matrix:
include:
- fdb: "7.3.62"
eunit: true
name: "macOS / FDB ${{ matrix.fdb }} (${{ matrix.eunit && 'eunit' || '' }})"
env:
FDB_VERSION: ${{ matrix.fdb }}
steps:
- uses: actions/checkout@v2
- name: Install
run: |
brew update
brew install erlang rebar3
curl -L "https://github.com/apple/foundationdb/releases/download/${{ env.FDB_VERSION }}/FoundationDB-${{ env.FDB_VERSION }}_arm64.pkg" > "FoundationDB-${{ env.FDB_VERSION }}.pkg"
sudo installer -allowUntrusted -verboseR -pkg "FoundationDB-${{ env.FDB_VERSION }}.pkg" -target /
- name: EUnit tests
run: rebar3 eunit
if: ${{ matrix.eunit }}