Skip to content

Commit

Permalink
Add GitHub Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Feb 10, 2021
1 parent 6cd4f51 commit fca961d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 12 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# GitHub Actions for PostGIS
#
# Paul Ramsey <pramsey at cleverelephant dot ca>

name: "CI"
on: [push, pull_request]

jobs:
linux:

env:
OS_VERSION: ubuntu-20.04
OS_PGNAME: focal-pgdg
OS_PGVER: 13

name: "CI"
strategy:
matrix:
ci:
- { PG_VERSION: 10 }
- { PG_VERSION: 11 }
- { PG_VERSION: 12 }
- { PG_VERSION: 13 }

runs-on: ubuntu-20.04

steps:

- name: 'Check Out'
uses: actions/checkout@v2

- name: 'Install'
run: |
export PG_VERSION=${{ matrix.ci.PG_VERSION }}
sudo /etc/init.d/postgresql stop
sudo apt-get -y --purge remove postgresql postgresql-common postgresql-$OS_PGVER postgresql-server-dev-$OS_PGVER postgresql-client-common postgresql-client-$OS_PGVER libpq-dev
sudo apt-get -y autoremove
sudo rm -rf /var/lib/postgresql
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $OS_PGNAME main $PG_VERSION"
sudo apt-get -y install libcurl4-gnutls-dev postgresql-$PG_VERSION postgresql-client-$PG_VERSION postgresql-server-dev-$PG_VERSION
sudo cp ./ci/pg_hba.conf /etc/postgresql/$PG_VERSION/main/pg_hba.conf
sudo /etc/init.d/postgresql stop
sudo /etc/init.d/postgresql start
- name: 'Build & Test'
run: |
export PATH=/usr/lib/postgresql/${{ matrix.ci.PG_VERSION }}/bin/:$PATH
make
sudo make install
PGUSER=postgres PGPORT=5432 make installcheck || (cat regression.diffs && /bin/false)
14 changes: 7 additions & 7 deletions expected/http.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ FROM http_get('https://httpbin.org/status/202');
(1 row)

-- Headers
SELECT *
SELECT lower(field) AS field, value
FROM (
SELECT (unnest(headers)).*
FROM http_get('https://httpbin.org/response-headers?Abcde=abcde')
) a
WHERE field = 'Abcde';
WHERE field ILIKE 'Abcde';
field | value
-------+-------
Abcde | abcde
abcde | abcde
(1 row)

-- GET
Expand Down Expand Up @@ -107,15 +107,15 @@ FROM http_post('https://httpbin.org/anything?foo=bar','payload','text/plain');
(1 row)

-- HEAD
SELECT *
SELECT lower(field) AS field, value
FROM (
SELECT (unnest(headers)).*
FROM http_head('https://httpbin.org/response-headers?Abcde=abcde')
) a
WHERE field = 'Abcde';
WHERE field ILIKE 'Abcde';
field | value
-------+-------
Abcde | abcde
abcde | abcde
(1 row)

-- Follow redirect
Expand All @@ -141,7 +141,7 @@ SELECT
length(textsend(http.content)) AS length_binary,
headers.value AS length_headers
FROM http, headers
WHERE field = 'Content-Length';
WHERE field ILIKE 'Content-Length';
content_type | length_binary | length_headers
--------------+---------------+----------------
image/png | 8090 | 8090
Expand Down
10 changes: 5 additions & 5 deletions sql/http.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ SELECT status
FROM http_get('https://httpbin.org/status/202');

-- Headers
SELECT *
SELECT lower(field) AS field, value
FROM (
SELECT (unnest(headers)).*
FROM http_get('https://httpbin.org/response-headers?Abcde=abcde')
) a
WHERE field = 'Abcde';
WHERE field ILIKE 'Abcde';

-- GET
SELECT status,
Expand Down Expand Up @@ -62,12 +62,12 @@ content::json->'method' AS method
FROM http_post('https://httpbin.org/anything?foo=bar','payload','text/plain');

-- HEAD
SELECT *
SELECT lower(field) AS field, value
FROM (
SELECT (unnest(headers)).*
FROM http_head('https://httpbin.org/response-headers?Abcde=abcde')
) a
WHERE field = 'Abcde';
WHERE field ILIKE 'Abcde';

-- Follow redirect
SELECT status,
Expand All @@ -88,7 +88,7 @@ SELECT
length(textsend(http.content)) AS length_binary,
headers.value AS length_headers
FROM http, headers
WHERE field = 'Content-Length';
WHERE field ILIKE 'Content-Length';

-- Alter options and and reset them and throw errors
SELECT http_set_curlopt('CURLOPT_PROXY', '127.0.0.1');
Expand Down

0 comments on commit fca961d

Please sign in to comment.