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
32 changes: 0 additions & 32 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
1 change: 0 additions & 1 deletion csv2db.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'mysql2', '~> 0.5.3'
spec.add_development_dependency 'rake', '~> 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
end
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.6.10}
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
20 changes: 18 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
#!/usr/bin/env sh
set -eu

echo "~~~ update RubyGems and Bundler"
# 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

echo "~~~ bundle install"
endgroup

group "bundle install"

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

endgroup
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 'csv2db'
require_relative '../app/models/concerns/csv2db/import'
Expand All @@ -21,7 +22,7 @@
end

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