Skip to content

Commit

Permalink
feat: enable all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BuonOmo committed Sep 4, 2024
1 parent a62542d commit c21dbce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ on:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test-ubuntu-ruby:
# 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:
Expand All @@ -27,8 +38,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# ruby-lang.org/en/downloads/branches
ruby: [ruby-head, "3.3", "3.2", "3.1"]
# https://ruby-lang.org/en/downloads/branches
ruby: ["3.3", "3.2", "3.1"]
# https://www.postgresql.org/support/versioning/
pg: [12-master, 13-master, 14-master, 15-master, 16-master]
steps:
Expand All @@ -41,12 +52,18 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Create Database
run: psql -d postgresql://postgres:postgres@localhost:5432/postgres -c "create database postgis_adapter_test"
- name: Create PostGIS Extension
run: psql -d postgresql://postgres:postgres@localhost:5432/postgis_adapter_test -c "create extension postgis"
- 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: localhost
PGUSER: postgres
PGPASSWORD: postgres
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require "rake/testtask"
require_relative "test/rake_helper"

task default: [:test]
task test: "test:postgis"
task test: "test:all"

Rake::TestTask.new(:test_postgis) do |t|
t.libs << postgis_test_load_paths
Expand Down

0 comments on commit c21dbce

Please sign in to comment.