-
Notifications
You must be signed in to change notification settings - Fork 9
81 lines (67 loc) · 2.31 KB
/
tests.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
name: tests
on:
pull_request:
push:
branches:
- master
jobs:
tests:
runs-on: ubuntu-22.04
env:
PG: ${{ matrix.postgres-version }}
strategy:
fail-fast: false
matrix:
postgres-version:
- '9.6'
- '10'
- '11'
- '12'
- '13'
- '14'
- '15'
- '16'
- '17'
steps:
- uses: actions/checkout@v2
- name: Set up packages
run: |
set -e
# add the official Ubuntu/Debian APT repository for PostgreSQL
sudo sh -c "echo \"deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main $PG\" > /etc/apt/sources.list.d/pgdg.list"
curl -Ls https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install --assume-yes --quiet --no-install-suggests --no-install-recommends curl postgresql-common lcov libkrb5-dev
# forbid creation of a "main" cluster when a new postgresql-x.y server package is installed
sudo sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf
sudo apt-get --assume-yes --quiet --no-install-suggests --no-install-recommends install postgresql-$PG postgresql-server-dev-$PG
- name: Compile and install pg_auth_mon
run: |
set -e
# utilities like pg_config are version-dependent, so we explicitly specify
# the correct path to avoid potential errors
export PATH=/usr/lib/postgresql/$PG/bin:$PATH
sudo PATH=$PATH make USE_PGXS=1 ENABLE_GCOV=1 install
sudo PATH=$PATH make USE_PGXS=1 ENABLE_GCOV=1 with_llvm=no clean all install
- name: Run tests
run: ./test.sh "${PG}"
- name: Generate lcov.info
run: |
gcov -lr *.[ch]
lcov --capture --directory . --no-external -o lcov.info
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
path-to-lcov: lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.postgres-version }}
parallel: true
finish:
needs: tests
runs-on: ubuntu-22.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true