File: ci.yml

package info (click to toggle)
pgq-node 3.5-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: sql: 1,412; python: 309; makefile: 14; sh: 1
file content (74 lines) | stat: -rw-r--r-- 2,067 bytes parent folder | download | duplicates (3)
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
#
# https://docs.github.com/en/actions
# https://github.com/actions
#

name: CI

on:
  pull_request: {}
  push: {}

jobs:

  linux:
    name: "Ubuntu 20.04 + PostgreSQL ${{matrix.PGVER}}"
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        PGVER: [10, 11, 12, 13, 14]
    steps:
      - name: "Checkout"
        uses: actions/checkout@v2

      - name: "InstallDB"
        run: |
          echo "::group::apt-get-update"
          echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.PGVER}}" \
          | sudo tee /etc/apt/sources.list.d/pgdg.list
          sudo -nH apt-get -q update
          echo "::endgroup::"

          echo "::group::apt-get-install"

          # disable new cluster creation
          sudo -nH mkdir -p /etc/postgresql-common/createcluster.d
          echo "create_main_cluster = false" | sudo -nH tee /etc/postgresql-common/createcluster.d/no-main.conf

          sudo -nH apt-get -qyu install \
            postgresql-${{matrix.PGVER}} \
            postgresql-server-dev-${{matrix.PGVER}} \
            libpq-dev patchutils
          echo "::endgroup::"

          # tune environment
          echo "/usr/lib/postgresql/${{matrix.PGVER}}/bin" >> $GITHUB_PATH
          echo "PGHOST=/tmp" >> $GITHUB_ENV

          dpkg -l postgres\* libpq\* bison\* flex\* gcc\* clang\* libllvm\*

      - name: "Build"
        run: make

      - name: "Install"
        run: |
          git clone -q https://github.com/pgq/pgq; make -C pgq
          sudo -nH bash -c "PATH='${PATH}' make install -C pgq"
          sudo -nH bash -c "PATH='${PATH}' make install"

      - name: "StartDB"
        run: |
          rm -rf data log
          mkdir -p log
          LANG=C initdb data
          sed -ri -e "s,^[# ]*(unix_socket_directories).*,\\1='/tmp'," data/postgresql.conf
          pg_ctl -D data -l log/pg.log start || { cat log/pg.log ; exit 1; }

      - name: "Test"
        run: make citest

      - name: "StopDB"
        run: |
          pg_ctl -D data stop
          rm -rf data log /tmp/.s.PGSQL*