Skip to content

Commit

Permalink
Merge pull request #109 from ThePletch/fix-ruby-ci-caching
Browse files Browse the repository at this point in the history
Fix CI caching, improve local dev, add view specs
  • Loading branch information
ThePletch authored Nov 24, 2023
2 parents a791f58 + 9fd9d66 commit 7a9ea29
Show file tree
Hide file tree
Showing 23 changed files with 471 additions and 169 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ env:
jobs:
build:
runs-on: ubuntu-latest
env:
BUNDLE_WITH: test
services:
postgres:
image: postgres:latest
Expand Down
22 changes: 11 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ gem 'commonmarker', '~> 1.0.0.pre9'
gem 'aws-sdk-s3', '~> 1.100', require: false
gem 'image_processing', '~> 1.2'

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem "icalendar", "~> 2.7"

gem "add_to_calendar", "~> 0.3.0"

gem "friendly_id", "~> 5.4"

gem "bootstrap_form", "~> 5"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'rb-readline'
Expand All @@ -65,14 +76,3 @@ group :test do
gem 'poltergeist', '~> 1.18'
gem 'database_cleaner', '~> 2.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem "icalendar", "~> 2.7"

gem "add_to_calendar", "~> 0.3.0"

gem "friendly_id", "~> 5.4"

gem "bootstrap_form", "~> 5"
151 changes: 76 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.5)
actionpack (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activesupport (= 7.0.5)
actionmailer (7.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.5)
actionview (= 7.0.5)
activesupport (= 7.0.5)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.5)
actionpack (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.5)
activesupport (= 7.0.5)
actionview (7.0.8)
activesupport (= 7.0.8)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.5)
activesupport (= 7.0.5)
activejob (7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.3.6)
activemodel (7.0.5)
activesupport (= 7.0.5)
activemodel (7.0.8)
activesupport (= 7.0.8)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.0.5)
activemodel (= 7.0.5)
activesupport (= 7.0.5)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activerecord-cockroachdb-adapter (7.0.2)
activerecord (~> 7.0.3)
pg (~> 1.2)
rgeo-activerecord (~> 7.0.0)
activestorage (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activesupport (= 7.0.5)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.5)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -131,7 +131,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
date (3.3.4)
devise (4.9.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand All @@ -156,8 +156,8 @@ GEM
ffi (1.15.5)
friendly_id (5.5.0)
activerecord (>= 4.0.0)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
haml (6.1.1)
temple (>= 0.8.2)
thor
Expand Down Expand Up @@ -188,7 +188,7 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -200,23 +200,23 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_magick (4.12.0)
mini_mime (1.1.2)
minitest (5.18.0)
net-imap (0.3.6)
mini_mime (1.1.5)
minitest (5.20.0)
net-imap (0.4.6)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.2-aarch64-linux)
nio4r (2.6.1)
nokogiri (1.15.5-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.2-arm64-darwin)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.2-x86_64-linux)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
pg (1.5.3)
Expand All @@ -228,42 +228,43 @@ GEM
public_suffix (5.0.1)
puma (6.3.1)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
racc (1.7.3)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.5)
actioncable (= 7.0.5)
actionmailbox (= 7.0.5)
actionmailer (= 7.0.5)
actionpack (= 7.0.5)
actiontext (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activemodel (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
bundler (>= 1.15.0)
railties (= 7.0.5)
railties (= 7.0.8)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -314,9 +315,9 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
temple (0.10.2)
thor (1.2.2)
thor (1.3.0)
tilt (2.2.0)
timeout (0.3.2)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2023.3)
Expand All @@ -328,12 +329,12 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
websocket-driver (0.7.5)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.8)
zeitwerk (2.6.12)

PLATFORMS
aarch64-linux
Expand Down
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,36 @@ Currently, I keep track of what features I want to add or upgrade in the Project

### Local Setup

This app doesn't do anything particularly unusual, as Rails apps go. It runs its database on PostgreSQL, uses Puma for its server, and Bundler for its dependencies. To run locally, you can just run the following commands from the repo's root directory, once you've cloned it:
This app doesn't do anything particularly unusual, as Rails apps go. It runs its database on PostgreSQL, uses Puma for its server, and Bundler for its dependencies.

#### Run with Docker Compose (preferred)

Running `docker compose up` will spin up a server and all dependencies. The local development server will listen on [port 23000](http://localhost:23000). Sidecar containers will also run on boot handle installing your bundle and running any pending migrations. If you change your dependency versions or add a new migration, you'll need to run the sidecars again to get things up to date:

```bash
$ bundle install
$ rails db:setup
$ rails server
docker compose run bundle-installer && docker compose run db-migrater
```

If you just want to run the test suite, you can spin up a shell (with dependencies) for testing by running the `docker-shell` executable in the `bin` directory:

```bash
./bin/dockershell
```

Running the tests is as simple as `bundle exec rspec`.

If you'd rather keep your local machine clean, you can use Docker Compose to manage your local environment by running `docker compose up`. The local development server will listen on [port 23000](http://localhost:23000).
#### Run directly

To run locally without using Docker, you can just run the following commands from the repo's root directory, once you've cloned it:

```bash
bundle install
rails db:setup
rails server
```

The above commands assume you have Ruby and Bundler installed and have a Postgres server running on your machine.

Running the tests is as simple as `bundle exec rspec`.

### Running your own instance of Parties for All

Expand Down
10 changes: 10 additions & 0 deletions app/assets/stylesheets/events.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@
.poll-response-label {
position: relative;
}

#event_secret + label::before {
content: '';
margin-right: 0.5em;
}

#event_secret:checked + label::before {
content: '';
margin-right: 0.5em;
}
2 changes: 1 addition & 1 deletion app/views/addresses/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
= form.text_field :city, floating: true
.col-md
- states = Carmen::Country.coded('USA').subregions.typed('state').map{|state| [state.name, state.code] }
= form.select :state, [[t('address.form.state_placeholder'), nil]] + states,floating: true
= form.select :state, [[t('address.form.state_placeholder'), nil]] + states, floating: true
.col-md
= form.text_field :zip_code, floating: true
Loading

0 comments on commit 7a9ea29

Please sign in to comment.