54 lines (54 loc) · 2.38 KB
/
pg.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
# This workflow tests Sqitch's PostgreSQL engine on all supported versions of
# Postgres. It runs for pushes and pull requests on the main and develop
# branches, or any time a file matching "pg.*" changes.
name: 🐘 Postgres
on: [push, pull_request]
jobs:
filter:
# No need to filter on develop or main.
if: github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
name: 🔎 Detect Postgres Changes
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with: { filters: '{ pg: [ "**/pg.*" ] }' }
Postgres:
# Run only on develop or main, or when a pg file has changed in the branch.
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || needs.filter.outputs.pg == 'true'
strategy:
matrix:
pg: [14, 13, 12, 11, 10, 9.6, 9.5, 9.4, 9.3] #, 9.2, 9.1, 9.0, 8.4] https://github.com/bucardo/dbdpg/issues/84
name: 🐘 Postgres ${{ matrix.pg }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup perl
id: perl
uses: shogo82148/actions-setup-perl@v1
with: { perl-version: latest }
- name: Cache CPAN Modules
uses: actions/cache@v2
with:
path: local/lib
key: perl-${{ steps.perl.outputs.perl-hash }}
- name: Download cpanfile
uses: carlosperate/download-file-action@v1.0.3
with:
file-url: https://fastapi.metacpan.org/source/DWHEELER/App-Sqitch-v1.1.0/dist/cpanfile
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile cpanfile
# DBD::Pg always build against the Debian packaged client, alas, so go
# ahead and let it be cached. If can figure out how to install the
# version-specific client (https://github.com/bucardo/dbdpg/issues/84),
# use cpm install --global to install DBD::Pg for a version-specific
# build each time.
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::Pg Algorithm::Backoff::Exponential
- name: Install Postgres
env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" }
run: dev/linux-pg ${{ matrix.pg }}
- name: prove
env:
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"
LIVE_PG_REQUIRED: true
run: prove -lvr t/pg.t