Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 5 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
bundle exec rubocop
rspec:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
services:
postgres:
image: postgres:10.11
Expand All @@ -46,26 +48,21 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run yarn install
run: yarn install --frozen-lockfile --ignore-scripts
- name: install Yarn packages
run: yarn --frozen-lockfile
- name: Precompile assets
env:
RAILS_ENV: test
NODE_OPTIONS: --openssl-legacy-provider
run: bundle exec rake webpacker:compile
run: bundle exec rails assets:precompile
- name: Configure database
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
ENCRYPTION_SERVICE_SALT: ${{ secrets.ENCRYPTION_SERVICE_SALT_FOR_RSPEC }}
run: |
bundle exec rake db:create db:schema:load
- name: Run Tests
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
run: |
bundle exec rspec
- uses: actions/upload-artifact@v4
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI and CD

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

env:
RACK_ENV: test
RAILS_ENV: test
DATABASE_URL: "postgresql://postgres:postgres@127.0.0.1/assure-test"

services:
postgres:
image: postgres:17.4-alpine
env:
POSTGRES_DB: assure-test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- uses: actions/setup-node@v4
with:
node-version: 24

- name: Find yarn cache location
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: JS package cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install packages with yarn
run: yarn install --frozen-lockfile

- name: Precompile assets
run: bin/rails assets:precompile

- name: Setup test database
run: bin/rails db:prepare

- name: Run linters
run: bundle exec rubocop

- name: Run tests
run: bundle exec rspec
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ build/
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

/public/system
/public/assets

# Asset pipeline
/app/assets/builds/*
!/app/assets/builds/.keep

/log
/log/*

set_env.sh
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ENV RAILS_ENV=production
ENV NODE_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
COPY . .
RUN bundle exec rake webpacker:compile SECRET_KEY_BASE=a-real-secret-key-is-not-needed-here NODE_OPTIONS=--openssl-legacy-provider
RUN bundle exec rails assets:compile SECRET_KEY_BASE=a-real-secret-key-is-not-needed-here NODE_OPTIONS=--openssl-legacy-provider
# tidy up installation
RUN apk del build-dependencies
# non-root/appuser should own only what they need to
Expand Down
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ source 'https://rubygems.org'
ruby file: ".ruby-version"

gem 'rails', '~> 8.0'
gem 'sprockets'
gem 'sprockets-rails'

gem 'puma'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
Expand All @@ -29,6 +25,11 @@ gem 'jbuilder'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 2', group: :doc

# Rails 7 asset management
gem "cssbundling-rails"
gem "jsbundling-rails"
gem "propshaft"

gem 'ostruct'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
Expand Down Expand Up @@ -76,5 +77,4 @@ end
# gem for heroku deployment
gem 'rails_12factor', group: :production

gem "webpacker", "~> 5.4"
gem "tzinfo-data"
43 changes: 12 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ GEM
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
crass (1.0.6)
cssbundling-rails (1.4.3)
railties (>= 6.0.0)
database_cleaner (2.1.0)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.2.2)
Expand Down Expand Up @@ -168,6 +170,8 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (8.0.0)
railties (>= 3.2.16)
jsbundling-rails (1.3.1)
railties (>= 6.0.0)
json (2.18.1)
jwt (3.1.2)
base64
Expand Down Expand Up @@ -259,6 +263,11 @@ GEM
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
propshaft (1.1.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -280,8 +289,6 @@ GEM
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
rack-proxy (0.7.7)
rack
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
Expand Down Expand Up @@ -388,20 +395,9 @@ GEM
rubocop (~> 1.81)
ruby-progressbar (1.13.0)
sass (3.4.25)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sdoc (2.6.5)
rdoc (>= 5.0)
securerandom (0.4.1)
semantic_range (3.1.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand All @@ -420,14 +416,6 @@ GEM
hashie (>= 0.1.0, < 6)
version_gem (>= 1.1.8, < 3)
spring (4.4.0)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
stringio (3.2.0)
temple (0.10.4)
thor (1.5.0)
Expand All @@ -451,11 +439,6 @@ GEM
version_gem (1.1.9)
warden (1.2.9)
rack (>= 2.0.9)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
Expand All @@ -464,14 +447,14 @@ GEM

PLATFORMS
aarch64-linux
ruby
x86_64-linux
x86_64-linux-musl

DEPENDENCIES
better_errors
byebug
cancancan
cssbundling-rails
database_cleaner
devise
factory_bot_rails
Expand All @@ -482,12 +465,14 @@ DEPENDENCIES
jbuilder
jquery-rails
jquery-ui-rails
jsbundling-rails
nokogiri (>= 1.16)
omniauth
omniauth-google-oauth2
omniauth-rails_csrf_protection
ostruct
pg
propshaft
pry-byebug
pry-rails
puma
Expand All @@ -500,17 +485,13 @@ DEPENDENCIES
rspec-rails
rubocop
rubocop-rspec
sass-rails
sdoc (~> 2)
simplecov
slim-rails
spring
sprockets
sprockets-rails
turbolinks
tzinfo-data
uglifier
webpacker (~> 5.4)

RUBY VERSION
ruby 4.0.1
Expand Down
2 changes: 0 additions & 2 deletions app/assets/config/manifest.js

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
// Any JavaScript/Coffee file within this directory, lib/assets/javascript, vendor/assets/javascript,
// or vendor/assets/javascript of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
Expand All @@ -18,6 +18,7 @@
//= require foundation
//= require details.polyfill
//= require_tree .
const images = require.context('../images', true)

$(function(){ $(document).foundation(); });

Expand Down
27 changes: 10 additions & 17 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*= require jquery-ui
*= require foundation-icons
*= require_tree .
*= require_self

*/
@import "jquery-ui/dist/themes/base/jquery-ui";
@import "foundation-icons/foundation-icons";
@import "countries";
@import "events";
@import "foundation_and_overrides";
@import "home";
@import "participating_country";
@import "profile";
@import "scoring";
@import "tables";
Loading
Loading