From 9c56a310f6decdd9f7cb6c3ea5a9da1ad08fab33 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Tue, 4 Jan 2022 00:34:14 +0200 Subject: [PATCH] Test for Ruby 3.1 --- .github/workflows/continuous-integration.yml | 6 +++- Dockerfile-3.1 | 30 +++++++++++++++++++ ...es.yml => docker-compose-3.1-postgres.yml} | 2 +- ...lite.yml => docker-compose-3.1-sqlite.yml} | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 Dockerfile-3.1 rename test-envs/{docker-compose-3.0-postgres.yml => docker-compose-3.1-postgres.yml} (96%) rename test-envs/{docker-compose-3.0-sqlite.yml => docker-compose-3.1-sqlite.yml} (93%) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index eb9ce9fda..a797307d3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,13 +6,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["2.6", "2.7", "3.0"] + ruby: ["2.6", "2.7", "3.0", "3.1"] db: [sqlite, mysql, postgres] exclude: - ruby: "2.6" db: sqlite - ruby: "2.6" db: postgres + - ruby: "3.0" + db: sqlite + - ruby: "3.0" + db: postgres steps: - uses: actions/checkout@v1 diff --git a/Dockerfile-3.1 b/Dockerfile-3.1 new file mode 100644 index 000000000..13ee22a20 --- /dev/null +++ b/Dockerfile-3.1 @@ -0,0 +1,30 @@ +FROM ruby:3.1 + +# throw errors if Gemfile has been modified since Gemfile.lock +RUN bundle config --global frozen 1 + +WORKDIR /app + +RUN touch /etc/app-env + +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN apt-get update && apt-get install -y yarn + +COPY Gemfile* /app/ +RUN gem install bundler +RUN bundle install --jobs 4 + +RUN mkdir /app/log + +COPY . /app/ +COPY config/database.docker.yml /app/config/database.yml +COPY config/site.docker.yml /app/config/site.yml + +RUN RAILS_ENV=production bundle exec rake assets:precompile + +ENTRYPOINT ["/app/docker-entrypoint.sh"] + +EXPOSE 3000 + +CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/test-envs/docker-compose-3.0-postgres.yml b/test-envs/docker-compose-3.1-postgres.yml similarity index 96% rename from test-envs/docker-compose-3.0-postgres.yml rename to test-envs/docker-compose-3.1-postgres.yml index 0c6d9b03e..8c8267279 100644 --- a/test-envs/docker-compose-3.0-postgres.yml +++ b/test-envs/docker-compose-3.1-postgres.yml @@ -10,7 +10,7 @@ services: web: build: context: .. - dockerfile: Dockerfile-3.0 + 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.0-sqlite.yml b/test-envs/docker-compose-3.1-sqlite.yml similarity index 93% rename from test-envs/docker-compose-3.0-sqlite.yml rename to test-envs/docker-compose-3.1-sqlite.yml index ba4d37094..925c1bc36 100644 --- a/test-envs/docker-compose-3.0-sqlite.yml +++ b/test-envs/docker-compose-3.1-sqlite.yml @@ -3,7 +3,7 @@ services: web: build: context: .. - dockerfile: Dockerfile-3.0 + dockerfile: Dockerfile-3.1 environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV