1

For a project that uses RGeo, I can't for the life of me find the magic combination to get it to work on GitHub Actions.

Please answer if you've actually got it working on GitHub Actions.

Gemfile

...
gem 'rgeo-geojson'
...

.github/workflows/beckend_test.yml

name: Backend Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: .
    services:
      postgres:
        image: geographica/postgis:dev_diplodocus
        ports:
          - 5432:5432
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: test
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
    env:
      RAILS_ENV: test
      RAILS_DATABASE_HOST: 127.0.0.1
      RAILS_DATABASE_USER: postgres
      RAILS_DATABASE_PASSWORD: postgres
    steps:
      - uses: actions/checkout@v3
      - name: Install Geos (Linux)
        run: |
          sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
          sudo apt-get install libgeos-dev -y
      - name: Install postgis
        run: sudo apt-get install postgis -y
      - name: Install Proj
        run: sudo apt-get install libproj-dev -y
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7.4
          bundler-cache: true
          working-directory: .
      - name: Manually install RGeo
        run: gem install rgeo
      - name: Migration
        run: |
          cp config/database.example.yml config/database.yml
          bundle exec rails db:create
          bundle exec rake db:schema:load
      - name: Run rspec
        run: bundle exec rspec

another attempt...

      - name: Migration
        run: |
          cp config/database.example.yml config/database.yml
          bundle exec rails db:create
          bundle exec rake db:schema:load
      - name: Manually reinstall RGeo
        run: gem uninstall rgeo && gem install rgeo

Expected behaviour

RGeo::Geos.capi_supported? == true

Actual behaviour

RGeo::Geos.capi_supported? == false
jnicho02
  • 2,567
  • 1
  • 15
  • 10
  • If it's in the Gemfile then with `bundler-cache: true`, it should automatically be installed. No need to install it separately. You should check the installation logs. Also, please verify locally and on GHA run whether you're using the right combination of gem versions with the Ruby 2.7.4 e.g. using `gem list` command. – Azeem May 16 '23 at 08:15

0 Answers0