Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
glacials committed Oct 4, 2024
1 parent 0dc07f2 commit 94ca596
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 32 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- name: Build environment
run: |
docker-compose build
docker-compose run web bundle install
docker-compose run web yarn install
docker-compose run -e RAILS_ENV=test web bundle exec rails db:migrate
docker compose build
docker compose run web bundle install
docker compose run web yarn install
docker compose run -e RAILS_ENV=test web bundle exec rails db:migrate
- name: Test Rails
run: docker-compose run -e RAILS_ENV=test web bundle exec rspec
run: docker compose run -e RAILS_ENV=test web bundle exec rspec
22 changes: 9 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
ARG RUBY_VERSION
FROM ruby:$RUBY_VERSION

ENV BUNDLE_PATH $GEM_HOME
ENV BUNDLE_APP_CONFIG $BUNDLE_PATH
ENV BUNDLE_BIN $BUNDLE_PATH/bin
ENV GEM_HOME /bundle
ENV LANG C.UTF-8
ENV NODE_MAJOR=20
ENV PATH /app/bin:$BUNDLE_BIN:$PATH

RUN sudo apt install
RUN wget https://dl.yarnpkg.com/debian/pubkey.gpg
RUN sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
RUN sudo apt-get update && sudo apt-get install libpq-dev nodejs postgresql-contrib -y
RUN curl https://deb.nodesource.com/setup_12.x | bash
RUN cat pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs yarn libvips-dev
RUN bundle config set force_ruby_platform true

ENV LANG C.UTF-8
ENV GEM_HOME /bundle
ENV BUNDLE_PATH $GEM_HOME
ENV BUNDLE_APP_CONFIG $BUNDLE_PATH
ENV BUNDLE_BIN $BUNDLE_PATH/bin
# Add bundle dir to path to be able to access commands outside of `bundle exec`
ENV PATH /app/bin:$BUNDLE_BIN:$PATH

RUN gem update --system

RUN mkdir -p /app
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source "https://rubygems.org"
ruby "3.3.0" # also update docker-compose.yml & docker-compose-production.yml
ruby "2.7.1" # also update docker-compose.yml & docker-compose-production.yml

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

Expand Down
17 changes: 8 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ GEM
unf (>= 0.0.5, < 1.0.0)
doorkeeper (5.6.6)
railties (>= 5)
enumerable-statistics (2.0.7)
enumerable-statistics (2.0.1)
erubi (1.12.0)
et-orbi (1.2.4)
tzinfo
Expand All @@ -194,7 +194,7 @@ GEM
railties (>= 4.2.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.16.3)
ffi (1.15.5)
font-awesome-sass (5.13.0)
sassc (>= 1.11)
friendly_uuid (0.3.0)
Expand All @@ -213,8 +213,7 @@ GEM
groupdate (5.0.0)
activesupport (>= 5)
hashie (5.0.0)
heapy (0.2.0)
thor
heapy (0.1.4)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
Expand Down Expand Up @@ -252,7 +251,7 @@ GEM
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
listen (3.8.0)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.3)
Expand Down Expand Up @@ -313,7 +312,7 @@ GEM
parser (2.7.1.3)
ast (~> 2.4.0)
patreon (0.2.0)
pg (1.5.4)
pg (1.2.3)
pg_search (2.3.2)
activerecord (>= 5.2)
activesupport (>= 5.2)
Expand Down Expand Up @@ -383,7 +382,7 @@ GEM
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.1.4)
Expand Down Expand Up @@ -460,7 +459,7 @@ GEM
simplecov (0.18.5)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
simplecov-html (0.12.2)
sinatra (3.0.6)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
Expand Down Expand Up @@ -587,7 +586,7 @@ DEPENDENCIES
websocket-driver!

RUBY VERSION
ruby 3.3.0p0
ruby 2.7.1p83

BUNDLED WITH
2.2.15
2 changes: 1 addition & 1 deletion docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ x-app: &app
cache_from:
- "${REPOSITORY_URI:-splitsio}:latest"
args:
RUBY_VERSION: '3.3.0' # also update docker-compose.yml & Gemfile
RUBY_VERSION: "2.7.1" # also update docker-compose.yml & Gemfile
environment: *server-environment
image: splitsio
logging: *default-logging
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ x-app: &app
build:
context: .
dockerfile: Dockerfile
cache_from:
- "${REPOSITORY_URI:-splitsio}:latest"
args:
RUBY_VERSION: '3.3.0' # also update docker-compose-production.yml & Gemfile
RUBY_VERSION: "2.7.1" # also update docker-compose-production.yml & Gemfile
image: splitsio
tmpfs:
- /tmp
Expand Down

0 comments on commit 94ca596

Please sign in to comment.