Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/ohm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@ jobs:
strategy:
matrix:
ruby: ['3.2']
fail-fast: false
runs-on: ubuntu-latest
env:
RAILS_ENV: test
OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1
PGGSSENCMODE: disable # attempt to solve "PG::Error: Unexpected binary struct layout "
timeout-minutes: 20
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Cache node modules
uses: actions/setup-node@v4
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
cache: yarn
- name: Install packages
Expand Down Expand Up @@ -59,21 +60,22 @@ jobs:
run: bundle exec i18n export
- name: Compile assets
run: bundle exec rails assets:precompile
timeout-minutes: 10
- name: Create tmp/pids directory
run: mkdir -p tmp/pids
- name: Run tests
run: bundle exec rails test:all
- name: Run javascript tests
run: bundle exec teaspoon
- name: Upload screenshots
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: failure()
with:
name: screenshots
path: tmp/screenshots
if-no-files-found: ignore
- name: Report completion to Coveralls
uses: coverallsapp/github-action@v2.3.6
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
flag-name: ruby-${{ matrix.ruby }}
Expand All @@ -83,9 +85,10 @@ jobs:
name: Finalise
needs: test
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Report completion to Coveralls
uses: coverallsapp/github-action@v2.3.6
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
19 changes: 10 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Tests
on:
workflow_dispatch:
push:
pull_request:
- workflow_dispatch
- push
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
Expand All @@ -12,22 +12,23 @@ jobs:
strategy:
matrix:
ruby: ['3.2', '3.3', '3.4']
fail-fast: false
runs-on: ubuntu-latest
env:
RAILS_ENV: test
OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1
timeout-minutes: 20
steps:
- name: Checkout source
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup ruby
uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Cache node modules
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
cache: yarn
- name: Install packages
Expand Down Expand Up @@ -65,14 +66,14 @@ jobs:
- name: Run javascript tests
run: bundle exec teaspoon
- name: Upload screenshots
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: failure()
with:
name: screenshots
path: tmp/screenshots
if-no-files-found: ignore
- name: Report completion to Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
flag-name: ruby-${{ matrix.ruby }}
Expand All @@ -85,7 +86,7 @@ jobs:
timeout-minutes: 1
steps:
- name: Report completion to Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gem "rails", "~> 8.0.0"
gem "turbo-rails"

# Use postgres as the database
gem "pg"
gem "pg", "~> 1.6"

# Use SCSS for stylesheets
gem "dartsass-sprockets"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ GEM
parser (3.3.8.0)
ast (~> 2.4.1)
racc
pg (1.5.9)
pg (1.6.2)
popper_js (2.11.8)
pp (0.6.2)
prettyprint
Expand Down Expand Up @@ -809,7 +809,7 @@ DEPENDENCIES
omniauth_openid_connect
openstreetmap-deadlock_retry (>= 1.3.1)
overcommit
pg
pg (~> 1.6)
puma (~> 6.6)
quad_tile (~> 1.0.1)
rack-cors
Expand Down Expand Up @@ -848,4 +848,4 @@ DEPENDENCIES
webrick

BUNDLED WITH
2.6.2
4.0.1
12 changes: 6 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ApplicationController < ActionController::Base
require "timeout"
# frozen_string_literal: true

class ApplicationController < ActionController::Base
include SessionPersistence

protect_from_forgery :with => :exception
Expand Down Expand Up @@ -57,8 +57,8 @@ def authorize_web(skip_terms: false)

redirect_to :controller => "users", :action => "suspended"

# don't allow access to any auth-requiring part of the site unless
# the new CTs have been seen (and accept/decline chosen).
# don't allow access to any auth-requiring part of the site unless
# the new CTs have been seen (and accept/decline chosen).
elsif !current_user.terms_seen && !skip_terms
flash[:notice] = t "accounts.terms.show.you need to accept or decline"
if params[:referer]
Expand Down Expand Up @@ -175,8 +175,8 @@ def report_error(message, status = :bad_request)
if request.headers["X-Error-Format"]&.casecmp?("xml")
result = OSM::API.new.xml_doc
result.root.name = "osmError"
result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
result.root << (XML::Node.new("message") << message)
result.root << (LibXML::XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
result.root << (LibXML::XML::Node.new("message") << message)

render :xml => result.to_s
else
Expand Down
Loading