-
Notifications
You must be signed in to change notification settings - Fork 18
190 lines (183 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
name: CI
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
otp_fdb_matrix:
strategy:
matrix:
otp-version: ['22', '23', '24']
fdb-version: ['6.3.22']
runs-on: ubuntu-latest
env:
FDB_VERSION: ${{ matrix.fdb-version }}
# Set to 1 for verbose rebar3 logging
DEBUG: 0
# Set to 1 for even more verbose rebar3 logging
DIAGNOSTIC: 0
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
persist-credentials: false
submodules: recursive
- name: Setup Erlang
uses: ./.github/actions/setup-beam
with:
otp-version: ${{ matrix.otp-version }}
rebar3-version: '3.17'
- 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
- name: Compile
run: rebar3 compile
- name: EUnit tests
run: rebar3 eunit
- name: Setup tmate session on job failure
uses: ./.github/actions/tmate
if: ${{ failure() }}
with:
limit-access-to-actor: true
os_fdb_matrix:
strategy:
matrix:
# erlef/setup-beam action does not support macos yet
os: [ubuntu-latest, windows-latest]
fdb-version: ['6.2.30', '6.3.22']
# Windows builds are not being published beyond 6.3.9 right now
exclude:
- os: windows-latest
fdb-version: '6.3.22'
include:
- os: windows-latest
fdb-version: '6.3.9'
runs-on: ${{ matrix.os }}
env:
FDB_VERSION: ${{ matrix.fdb-version }}
# This profile uses the FDB server started in the "Install FoundationDB" step
# instead of starting another one (the code that manages the "local" FDB in the
# test suite is not designed with x-platform compatibility in mind)
REBAR_PROFILE: devcontainer
# Set to 1 for verbose rebar3 logging
DEBUG: 0
# Set to 1 for even more verbose rebar3 logging
DIAGNOSTIC: 0
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
persist-credentials: false
submodules: recursive
- name: Setup Erlang
uses: ./.github/actions/setup-beam
with:
otp-version: '24'
rebar3-version: '3.17'
- name: Setup MSVC toolchain
if: ${{ matrix.os == 'windows-latest' }}
uses: ./.github/actions/msvc-dev-cmd
- name: Install FoundationDB (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
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
- name: Install FoundationDB (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-PSDebug -Trace 1
Invoke-WebRequest -Uri https://github.com/apple/foundationdb/releases/download/$env:FDB_VERSION/foundationdb-$env:FDB_VERSION-x64.msi -OutFile foundationdb-$env:FDB_VERSION-x64.msi
Start-Process -Wait -FilePath msiexec -ArgumentList /i, foundationdb-$env:FDB_VERSION-x64.msi, /passive
echo "C:\Program Files\foundationdb\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install FoundationDB (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
wget https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/FoundationDB-${FDB_VERSION}.pkg
sudo installer -allowUntrusted -verboseR -pkg FoundationDB-${FDB_VERSION}.pkg -target /
- name: Compile
run: rebar3 compile
- name: EUnit tests
run: rebar3 eunit
- name: Setup tmate session on job failure
uses: ./.github/actions/tmate
if: ${{ failure() }}
with:
limit-access-to-actor: true
binding_tester:
runs-on: ubuntu-latest
strategy:
matrix:
test-name: [api, directory, directory_hca, tuple]
api-version: [610, 620, 630]
include:
# The `scripted` test only supports the latest API version
- test-name: scripted
api-version: 630
container:
image: apache/couchdbci-debian:erlfdb-erlang-24.1.5.0-fdb-6.3.18-1
services:
foundationdb:
image: foundationdb/foundationdb:6.3.18
env:
# This profile just ensures we use the FDB server in the service container
REBAR_PROFILE: devcontainer
steps:
- name: Create FDB cluster file
env:
# This needs to match the name of the service above so the script can do
# a DNS lookup to write down the coordinator IP in the fdb.cluster file
FDB_COORDINATOR: foundationdb
shell: bash
run: /usr/local/bin/create_cluster_file.bash
- name: Initialize FDB database
run: fdbcli --exec "configure new single ssd"
- name: Check out repository code
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Compile erlfdb
run: rebar3 compile
- name: Execute unit tests
run: rebar3 eunit
- name: Execute binding test
env:
TEST_NAME: ${{ matrix.test-name }}
API_VERSION: ${{ matrix.api-version }}
COVER_ENABLED: true
ERL_LIBS: _build/devcontainer+test/lib/erlfdb/
run: |
mkdir -p /usr/src/erlfdb/test/
ln -s $GITHUB_WORKSPACE/test/tester.es /usr/src/erlfdb/test/tester.es
/usr/src/foundationdb/bindings/bindingtester/bindingtester.py erlang \
--test-name $TEST_NAME \
--api-version $API_VERSION \
--instruction-prefix $TEST_NAME \
--num-ops 10000
- name: Upload results to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: bindingtest-${{ matrix.test-name }}-${{ matrix.api-version }}
run: rebar3 as test coveralls send
finalize_coverage_report:
needs: [binding_tester]
runs-on: ubuntu-latest
steps:
- name: Finalize Coveralls report
run: |
curl https://coveralls.io/webhook \
--header 'Content-Type: application/json' \
--data '{
"repo_name": "${{ github.repository }}",
"repo_token": "${{ secrets.GITHUB_TOKEN }}",
"payload": {
"build_num": ${{ github.run_number }},
"status": "done"
}
}'