Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .buildkite/pipeline.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .buildkite/test.sh

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test Suite

on:
push:
workflow_dispatch:

jobs:
spec:
name: RSpec
runs-on: ubuntu-latest

container:
image: ruby:2.7.8
credentials:
username: ${{ secrets.ORG_DOCKERHUB_USERNAME }}
password: ${{ secrets.ORG_DOCKERHUB_TOKEN }}
env:
DB_HOST: db
DB_USERNAME: root

services: # versions here should match those used in docker-compose.yml
db:
image: mysql:8.0.34
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3

steps:
- uses: actions/checkout@v4

- name: Run RSpec
shell: script -q -e -c "bash {0}" # force colour output - see https://github.com/actions/runner/issues/241
run: |
set -euo pipefail

./docker-entrypoint.sh

mkdir -p tmp
mkdir -p log

bin/rspec

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: "test.log"
path: log/test.log
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in report_generator.gemspec
gemspec

rails_version = ENV['RAILS_VERSION']
rails_version = '4.2' if !rails_version || rails_version.strip.empty?

gem 'railties', "~> #{rails_version}"
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
app:
image: ruby:${RUBY_VERSION:-2.5.8}
image: ruby:${RUBY_VERSION:-2.7.8}
working_dir: /app
command: >
bash -eu -c '
Expand All @@ -18,7 +18,7 @@ services:
- .:/app:cached

db:
image: mysql:5.7
image: mysql:8.0.34
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
expose:
Expand Down
31 changes: 21 additions & 10 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
#!/usr/bin/env sh
set -eu

echo "~~~ update RubyGems and Bundler"
if [ "${RUBY_VERSION:-}" = "2.6.10" ]; then
gem install bundler -v "~> 2.4.22"
gem update --system 3.4.22 >/dev/null
else
gem install bundler -v 2.3.27
gem update --system 3.2.3 >/dev/null
fi

echo "~~~ bundle install"
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#grouping-log-lines
group() {
echo "::group::${1}"
}

endgroup() {
echo "::endgroup::"
}

group "update RubyGems and Bundler"

# latest supported versions for Ruby 2.x
gem install bundler -v "~> 2.4.22"
gem update --system 3.4.22 >/dev/null

endgroup

group "bundle install"

bundle install \
--jobs "$(getconf _NPROCESSORS_ONLN)" \
--retry 2

endgroup
1 change: 0 additions & 1 deletion report_generator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'dragonfly-s3_data_store', '~> 1.3'
spec.add_development_dependency 'mysql2', '~> 0.5.3'
spec.add_development_dependency 'rake', '~> 12.3.3'
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
spec.add_development_dependency 'rspec-rails', '~> 3.0'
end
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'bundler/setup'
require 'byebug'
require 'mysql2'
require 'logger'
require 'rails/all'
require 'rspec/rails'
require 'active_support/testing/time_helpers'
Expand Down Expand Up @@ -30,7 +31,7 @@
Rails.application = ReportGenerator::Engine

db_config = {
database: "report_generator_test#{ENV['CIRCLE_NODE_INDEX']}",
database: 'report_generator_test',
adapter: 'mysql2',
encoding: 'utf8mb4',
pool: 5,
Expand Down