1name: Build for Ubuntu with clang
2
3on:
4  push:
5    branches-ignore:
6      - 'translations_*'
7    tags: []
8  pull_request:
9    paths-ignore:
10      - '**.po'
11
12
13jobs:
14  build:
15    name: Build
16    runs-on: ${{ matrix.os }}
17
18    strategy:
19        fail-fast: false
20        matrix:
21          psql: [12]
22          postgis: [3]
23          os: [ubuntu-latest]
24
25    steps:
26      - uses: actions/checkout@v2
27
28      - name: get postgres version
29        run: |
30          sudo service postgresql start
31          pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d \()')
32          echo "PGVER=${pgver}" >> $GITHUB_ENV
33          PGP=5433
34          if [ "${{ matrix.psql }}" == "${pgver}" ]; then PGP=5432; fi
35          echo "PGPORT=${PGP}" >> $GITHUB_ENV
36
37      - name: Add PostgreSQL APT repository
38        run: |
39          sudo apt-get install curl ca-certificates gnupg
40          curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
41          sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
42            $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
43
44      - name: Install dependencies
45        run: |
46          sudo apt-get update
47          sudo apt-get install -y \
48            clang \
49            libboost-graph-dev \
50            libtap-parser-sourcehandler-pgtap-perl \
51            postgresql-${{ matrix.psql }} \
52            postgresql-${{ matrix.psql }}-pgtap \
53            postgresql-${{ matrix.psql }}-postgis-${{ matrix.postgis }} \
54            postgresql-${{ matrix.psql }}-postgis-${{ matrix.postgis }}-scripts \
55            postgresql-server-dev-${{ matrix.psql }}
56
57      - name: Configure
58        run: |
59          export PATH=/usr/lib/postgresql/${{ matrix.psql }}/bin:$PATH
60          mkdir build
61          cd build
62          CXX=clang++ CC=clang cmake -DPOSTGRESQL_VERSION=${{ matrix.psql }} -DCMAKE_BUILD_TYPE=Debug -DWITH_DOC=OFF ..
63
64      - name: Build
65        run: |
66          cd build
67          make -j 4
68          sudo make install
69
70      - name: Test
71        run: |
72          echo "test pending"
73          sudo service postgresql start
74          sudo -u postgres createdb -p ${PGPORT}  ___pgr___test___
75          sudo -u postgres bash ./tools/testers/pg_prove_tests.sh postgres ${PGPORT}  Debug
76