From 870b9a358ff9cea2b35cd2bbb5caa49561ab3e37 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 7 Jul 2026 12:06:15 -0500 Subject: [PATCH] Update to Ruby 3.4, enable Rubocop The Rubocop configuration was present, but Rubocop failed to start up because the Docker user's home directory didn't exist. This commit changes the home directory for the Docker user to `/opt/app` so that Rubocop can start correctly. Add Rubocop to GitHub Actions. There are no violations. Closes: AP-772 --- .github/workflows/build.yml | 5 +++++ .gitignore | 2 ++ Dockerfile | 6 +++--- Gemfile.lock | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c34f7d8..348a7bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,11 @@ jobs: run: | docker compose exec -e RAILS_ENV=test app rspec --format progress --format html --out artifacts/rspec.html + - name: Run Rubocop + if: ${{ always() }} + run: | + docker compose exec app rubocop --format progress --format html --out artifacts/rubocop.html + - name: Copy out artifacts if: ${{ always() }} run: | diff --git a/.gitignore b/.gitignore index e6fa9c0..d1e40d0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ testfiles/* secrets/* !secrets/.keep + +.cache diff --git a/Dockerfile b/Dockerfile index d8cb4eb..3f435c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ #FROM debian:bullseye-slim -FROM ruby:3.3-slim AS base +FROM ruby:3.4-slim AS base USER root RUN apt-get update # Create the application user/group and application directory RUN groupadd -g 40054 alma && \ - useradd -r -s /sbin/nologin -M -u 40054 -g alma alma && \ + useradd -r -s /sbin/nologin -M -u 40054 -g alma -d /opt/app alma && \ mkdir -p /opt/app && \ chown -R alma:alma /opt/app @@ -24,7 +24,7 @@ RUN apt-get install -y --no-install-recommends \ USER alma -RUN gem install bundler --version 4.0.9 +RUN gem install bundler --version 4.0.15 COPY --chown=alma:alma Gemfile* ./ RUN bundle install COPY --chown=alma:alma . . diff --git a/Gemfile.lock b/Gemfile.lock index 046cca9..e695219 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,4 +102,4 @@ DEPENDENCIES thor (~> 1.1) BUNDLED WITH - 4.0.9 + 4.0.15