Skip to content

Commit

Permalink
Add test script to check each version of Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Tarulli committed Feb 20, 2022
1 parent 321d5a8 commit 65f8851
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG VERSION
FROM ruby:${VERSION}

WORKDIR /workspace
RUN mkdir -p lib/crockford32
COPY Gemfile Gemfile.lock crockford32.gemspec ./
COPY lib/crockford32/version.rb ./lib/crockford32/
RUN gem install bundler:2.3.3 && bundle install
23 changes: 23 additions & 0 deletions bin/test_versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail

RUBY_VERSIONS=(
2.6.0
2.6.9
2.7.0
2.7.5
3.0.0
3.0.3
3.1.0
)

IMAGE_PREFIX="crockford32"

for v in ${RUBY_VERSIONS[@]}; do
docker build -t "${IMAGE_PREFIX}:${v}" --build-arg "VERSION=${v}" .
done

for v in ${RUBY_VERSIONS[@]}; do
echo "Running tests for Ruby ${v}..."
docker run --rm -ti -v "${PWD}:/workspace" "${IMAGE_PREFIX}:${v}" bundle exec rake
done

0 comments on commit 65f8851

Please sign in to comment.