Skip to content

Commit c21dbce

Browse files
committed
feat: enable all tests
1 parent a62542d commit c21dbce

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

.github/workflows/tests.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ on:
44
branches:
55
- master
66
pull_request:
7+
types: [opened, reopened, synchronize]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
710

811
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:
1021
runs-on: ubuntu-latest
1122
services:
1223
postgis:
@@ -27,8 +38,8 @@ jobs:
2738
strategy:
2839
fail-fast: false
2940
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"]
3243
# https://www.postgresql.org/support/versioning/
3344
pg: [12-master, 13-master, 14-master, 15-master, 16-master]
3445
steps:
@@ -41,12 +52,18 @@ jobs:
4152
with:
4253
ruby-version: ${{ matrix.ruby }}
4354
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
4864
- name: Run Tests
4965
run: bundle exec rake test
5066
env:
5167
PGHOST: localhost
68+
PGUSER: postgres
5269
PGPASSWORD: postgres

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require "rake/testtask"
33
require_relative "test/rake_helper"
44

55
task default: [:test]
6-
task test: "test:postgis"
6+
task test: "test:all"
77

88
Rake::TestTask.new(:test_postgis) do |t|
99
t.libs << postgis_test_load_paths

0 commit comments

Comments
 (0)