-
Notifications
You must be signed in to change notification settings - Fork 58
86 lines (85 loc) · 3.07 KB
/
test.yaml
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
name: test
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13]
postgres: [11, 12, 13, 14, 15, 16]
steps:
- uses: actions/checkout@v3
with:
# fetch-depth ensures all tags are present on the repo so we can run update tests successfully
fetch-depth: 0
submodules: "recursive"
- name: Build
id: build
run: sudo sh -c "PG_VERSION=$PG_VERSION USE_SOURCE=1 GITHUB_OUTPUT=$GITHUB_OUTPUT ENABLE_COVERAGE=1 ./ci/scripts/build.sh"
env:
PG_VERSION: ${{ matrix.postgres }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run tests linux
id: test-linux
run: sudo su postgres -c "PG_VERSION=$PG_VERSION RUN_REPLICA_TESTS=$RUN_REPLICA_TESTS ./ci/scripts/run-tests-linux.sh"
env:
RUN_REPLICA_TESTS: "${{ matrix.postgres == 15 && '1' || '0' }}"
PG_VERSION: ${{ matrix.postgres }}
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Run update tests linux
id: update-test-linux
run: |
sudo pip install GitPython &&\
# Start postgres
sudo su postgres -c "PG_VERSION=$PG_VERSION RUN_TESTS=0 ./ci/scripts/run-tests-linux.sh" && \
sudo su -c "PG_VERSION=$PG_VERSION python3 ./scripts/test_updates.py -U postgres" &&\
echo "Done with updates"
env:
PG_VERSION: ${{ matrix.postgres }}
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Run tests mac
id: test-mac
run: ./ci/scripts/run-tests-mac.sh
env:
PG_VERSION: ${{ matrix.postgres }}
if: ${{ startsWith(matrix.os, 'mac') }}
- name: Upload Postgres logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: postgres-server-${{ matrix.postgres }}-logs
path: |
/tmp/pg-out.log
/tmp/pg-error.log
- name: Upload to codecov
uses: codecov/codecov-action@v3
env:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ env.codecov_token != '' && startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 }} # for now run only on once
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-lanterndb
fail_ci_if_error: true
files: /tmp/coverage.xml
- name: Check clang formatting
run: "cd /tmp/lantern/build && make format_check"