From d5235e8c61ae04edc103508d7edf5b5ba541530a Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Mon, 17 Jun 2024 12:46:16 +0300 Subject: [PATCH] Move default build to Ruby 3.3, test only MySQL for Rubies 3.1 & 3.2 (middle versions) --- .github/workflows/continuous-integration.yml | 4 +++ Dockerfile | 4 +-- Dockerfile-3.3 => Dockerfile-3.1 | 2 +- test-envs/docker-compose-3.1-mysql.yml | 2 +- test-envs/docker-compose-3.1-postgres.yml | 32 -------------------- test-envs/docker-compose-3.1-sqlite.yml | 17 ----------- test-envs/docker-compose-3.2-postgres.yml | 32 -------------------- test-envs/docker-compose-3.2-sqlite.yml | 17 ----------- 8 files changed, 8 insertions(+), 102 deletions(-) rename Dockerfile-3.3 => Dockerfile-3.1 (98%) delete mode 100644 test-envs/docker-compose-3.1-postgres.yml delete mode 100644 test-envs/docker-compose-3.1-sqlite.yml delete mode 100644 test-envs/docker-compose-3.2-postgres.yml delete mode 100644 test-envs/docker-compose-3.2-sqlite.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3c2385529..9d89cdfa7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,6 +9,10 @@ jobs: ruby: ["3.0", "3.1", "3.2", "3.3"] db: [sqlite, mysql, postgres] exclude: + - ruby: "3.1" + db: sqlite + - ruby: "3.1" + db: postgres - ruby: "3.2" db: sqlite - ruby: "3.2" diff --git a/Dockerfile b/Dockerfile index f1f6d7cd7..1a637febf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1 +FROM ruby:3.3 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 @@ -8,7 +8,7 @@ WORKDIR /app RUN touch /etc/app-env COPY Gemfile* /app/ -RUN gem install bundler -v 2.4.22 +RUN gem install bundler RUN bundle install --jobs 4 RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - diff --git a/Dockerfile-3.3 b/Dockerfile-3.1 similarity index 98% rename from Dockerfile-3.3 rename to Dockerfile-3.1 index 0e143fd71..13ee22a20 100644 --- a/Dockerfile-3.3 +++ b/Dockerfile-3.1 @@ -1,4 +1,4 @@ -FROM ruby:3.2 +FROM ruby:3.1 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 diff --git a/test-envs/docker-compose-3.1-mysql.yml b/test-envs/docker-compose-3.1-mysql.yml index 67e67f174..03f609e5d 100644 --- a/test-envs/docker-compose-3.1-mysql.yml +++ b/test-envs/docker-compose-3.1-mysql.yml @@ -10,7 +10,7 @@ services: web: build: context: .. - dockerfile: Dockerfile + dockerfile: Dockerfile-3.1 environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV diff --git a/test-envs/docker-compose-3.1-postgres.yml b/test-envs/docker-compose-3.1-postgres.yml deleted file mode 100644 index a66d41b21..000000000 --- a/test-envs/docker-compose-3.1-postgres.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' -services: - db: - image: postgres:13 - environment: - POSTGRES_DB: ${DATABASE_NAME:-tracks} - POSTGRES_PASSWORD: password - volumes: - - db-data:/var/lib/postgresql/data - web: - build: - context: .. - dockerfile: Dockerfile - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_TYPE: postgresql - DATABASE_ENCODING: unicode - DATABASE_PORT: 5432 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.1-sqlite.yml b/test-envs/docker-compose-3.1-sqlite.yml deleted file mode 100644 index 4fd50bd59..000000000 --- a/test-envs/docker-compose-3.1-sqlite.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' -services: - web: - build: - context: .. - dockerfile: Dockerfile - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: "/app/db.sqlite" - DATABASE_TYPE: sqlite3 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 diff --git a/test-envs/docker-compose-3.2-postgres.yml b/test-envs/docker-compose-3.2-postgres.yml deleted file mode 100644 index 16711e2d7..000000000 --- a/test-envs/docker-compose-3.2-postgres.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' -services: - db: - image: postgres:13 - environment: - POSTGRES_DB: ${DATABASE_NAME:-tracks} - POSTGRES_PASSWORD: password - volumes: - - db-data:/var/lib/postgresql/data - web: - build: - context: .. - dockerfile: Dockerfile-3.2 - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_TYPE: postgresql - DATABASE_ENCODING: unicode - DATABASE_PORT: 5432 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.2-sqlite.yml b/test-envs/docker-compose-3.2-sqlite.yml deleted file mode 100644 index 47a2e7e08..000000000 --- a/test-envs/docker-compose-3.2-sqlite.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' -services: - web: - build: - context: .. - dockerfile: Dockerfile-3.2 - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: "/app/db.sqlite" - DATABASE_TYPE: sqlite3 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000