-
-
Notifications
You must be signed in to change notification settings - Fork 242
75 lines (73 loc) · 2.28 KB
/
tests.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Tests
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs.
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
cancel-in-progress: true
jobs:
# Since the name of the matrix job depends on the version, we define another job with a more stable name.
test_results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Test Results
needs: [test]
steps:
- run: '[[ "${{ needs.test.result }}" == "success" ]]'
test:
runs-on: ubuntu-latest
services:
postgis:
image: postgis/postgis:${{matrix.pg}}
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--name=postgres
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
BUNDLE_GEMFILE: ${{matrix.gemfile}}
strategy:
fail-fast: false
matrix:
# https://ruby-lang.org/en/downloads/branches
ruby: ["3.3"]
# https://www.postgresql.org/support/versioning/
pg: [16-master]
steps:
- name: Set Up Actions
uses: actions/checkout@v4
- name: Install GEOS
run: sudo apt-get install libgeos-dev
- name: Set Up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup Database
run: |
psql -d postgresql://postgres:postgres@localhost:5432/postgres \
-c "create database postgis_adapter_test" \
-c "create database activerecord_unittest" \
-c "create database activerecord_unittest2"
for db in postgis_adapter_test activerecord_unittest activerecord_unittest2; do
psql -d postgresql://postgres:postgres@localhost:5432/$db -c "create extension postgis"
done
- name: Run Tests
run: bundle exec rake test
env:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
TESTOPTS: --verbose --name=/PostgresqlHstoreTest/