diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed613820..61f27281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,57 +1,53 @@ -name: CI -on: [pull_request] +# .github/workflows/ruby.yml +name: Ruby + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + jobs: - build: + tests: + name: Tests runs-on: ubuntu-latest + services: postgres: image: postgres:12 - ports: - - 5432:5432 env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + POSTGRES_PASSWORD: password + ports: ['5432:5432'] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - - uses: actions/checkout@v1 + - name: Checkout code + uses: actions/checkout@v2 - - name: Setup Ruby and install gems + - name: Setup Ruby uses: ruby/setup-ruby@v1 with: + ruby-version: 3.2.2 bundler-cache: true - - name: Install dependent libraries - run: sudo apt-get install libpq-dev - - - name: Bundle install + - name: Install dependencies run: | - gem install bundler + sudo apt-get update && sudo apt-get -yqq install libpq-dev bundle install --jobs 4 --retry 3 - - - name: Install daisyui - run: npm i daisyui - - - name: Compile assets - run: bundle exec rake assets:precompile - - - name: Setup Database + - name: Run Tests + env: + RAILS_ENV: test + PGHOST: localhost + DISABLE_SPRING: 1 run: | - cp config/database.yml.github-actions config/database.yml - bundle exec rake db:create - bundle exec rake db:schema:load - env: - RAILS_ENV: test - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - - - name: Run RSpec - run: COVERAGE=true bundle exec rspec --require rails_helper - env: - RAILS_ENV: test - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - - - name: Simplecov Report - uses: aki77/simplecov-report-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + cp config/database.ci.yml config/database.yml + bundle exec rails db:schema:load + bundle exec rspec --format progress diff --git a/Gemfile.lock b/Gemfile.lock index d303f75b..a1791910 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,11 +77,11 @@ GEM ast (2.4.2) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.5) - bootsnap (1.17.0) + bigdecimal (3.1.6) + bootsnap (1.18.3) msgpack (~> 1.2) builder (3.2.4) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) @@ -94,12 +94,11 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) erubi (1.12.0) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) @@ -108,16 +107,16 @@ GEM foreman (0.87.2) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) importmap-rails (2.0.1) actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) - io-console (0.7.1) - irb (1.11.0) + io-console (0.7.2) + irb (1.12.0) rdoc - reline (>= 0.3.8) + reline (>= 0.4.2) json (2.7.1) language_server-protocol (3.17.0.3) loofah (2.22.0) @@ -128,41 +127,41 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.22.2) msgpack (1.7.2) mutex_m (0.2.0) - net-imap (0.4.9) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.4.0.1) net-protocol nio4r (2.7.0) - nokogiri (1.16.0-aarch64-linux) + nokogiri (1.16.2-aarch64-linux) racc (~> 1.4) - nokogiri (1.16.0-arm64-darwin) + nokogiri (1.16.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-linux) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) parallel (1.24.0) - parser (3.2.2.4) + parser (3.3.0.5) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.6) psych (5.1.2) stringio - puma (6.4.0) + puma (6.4.2) nio4r (~> 2.0) pundit (2.3.1) activesupport (>= 3.0.0) racc (1.7.3) - rack (3.0.8) + rack (3.0.9.1) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -203,26 +202,26 @@ GEM rake (13.1.0) rdoc (6.6.2) psych (>= 4.0.0) - redis (5.0.8) + redis (5.1.0) redis-client (>= 0.17.0) - redis-client (0.19.1) + redis-client (0.21.0) connection_pool - regexp_parser (2.8.3) - reline (0.4.2) + regexp_parser (2.9.0) + reline (0.4.3) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.1) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -230,28 +229,27 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.1) - rubocop (1.59.0) + rspec-support (3.13.1) + rubocop (1.62.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-rails (2.23.1) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-rails (2.24.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - shoulda-matchers (6.0.0) + shoulda-matchers (6.1.0) activesupport (>= 5.2.0) simplecov (0.22.0) docile (~> 1.1) @@ -266,20 +264,20 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - stimulus-rails (1.3.0) + stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.0) - strong_migrations (1.6.4) + strong_migrations (1.7.0) activerecord (>= 5.2) - tailwindcss-rails (2.1.0-aarch64-linux) + tailwindcss-rails (2.3.0-aarch64-linux) railties (>= 6.0.0) - tailwindcss-rails (2.1.0-arm64-darwin) + tailwindcss-rails (2.3.0-arm64-darwin) railties (>= 6.0.0) - tailwindcss-rails (2.1.0-x86_64-linux) + tailwindcss-rails (2.3.0-x86_64-linux) railties (>= 6.0.0) - thor (1.3.0) + thor (1.3.1) timeout (0.4.1) - turbo-rails (1.5.0) + turbo-rails (2.0.5) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) @@ -292,7 +290,7 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.12) + zeitwerk (2.6.13) PLATFORMS aarch64-linux diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7a24777d..97be0ffd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,43 +1,15 @@ - + SoloCustomerTemplate <%= csrf_meta_tags %> <%= csp_meta_tag %> - + <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> - <%= javascript_importmap_tags %> diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb index 4d0737e2..ac3a4d36 100644 --- a/app/views/shared/_navbar.html.erb +++ b/app/views/shared/_navbar.html.erb @@ -9,7 +9,11 @@ <%= link_to 'SoloCustomerTemplate', root_path, class: 'btn btn-ghost normal-case text-xl'%> - +