4
4
branches :
5
5
- master
6
6
pull_request :
7
+ types : [opened, reopened, synchronize]
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch :
7
10
8
11
jobs :
9
- test-ubuntu-ruby :
12
+ # Since the name of the matrix job depends on the version, we define another job with a more stable name.
13
+ test_results :
14
+ if : ${{ always() }}
15
+ runs-on : ubuntu-latest
16
+ name : Test Results
17
+ needs : [test]
18
+ steps :
19
+ - run : ' [[ "${{ needs.test.result }}" == "success" ]]'
20
+ test :
10
21
runs-on : ubuntu-latest
11
22
services :
12
23
postgis :
27
38
strategy :
28
39
fail-fast : false
29
40
matrix :
30
- # ruby-lang.org/en/downloads/branches
31
- ruby : [ruby-head, "3.3", "3.2", "3.1"]
41
+ # https:// ruby-lang.org/en/downloads/branches
42
+ ruby : ["3.3", "3.2", "3.1"]
32
43
# https://www.postgresql.org/support/versioning/
33
44
pg : [12-master, 13-master, 14-master, 15-master, 16-master]
34
45
steps :
@@ -41,12 +52,18 @@ jobs:
41
52
with :
42
53
ruby-version : ${{ matrix.ruby }}
43
54
bundler-cache : true
44
- - name : Create Database
45
- run : psql -d postgresql://postgres:postgres@localhost:5432/postgres -c "create database postgis_adapter_test"
46
- - name : Create PostGIS Extension
47
- run : psql -d postgresql://postgres:postgres@localhost:5432/postgis_adapter_test -c "create extension postgis"
55
+ - name : Setup Database
56
+ run : |
57
+ psql -d postgresql://postgres:postgres@localhost:5432/postgres \
58
+ -c "create database postgis_adapter_test" \
59
+ -c "create database activerecord_unittest" \
60
+ -c "create database activerecord_unittest2"
61
+ for db in postgis_adapter_test activerecord_unittest activerecord_unittest2; do
62
+ psql -d postgresql://postgres:postgres@localhost:5432/$db -c "create extension postgis"
63
+ done
48
64
- name : Run Tests
49
65
run : bundle exec rake test
50
66
env :
51
67
PGHOST : localhost
68
+ PGUSER : postgres
52
69
PGPASSWORD : postgres
0 commit comments