Skip to content

Commit

Permalink
script to help run across build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
davetron5000 committed Jul 17, 2024
1 parent dfe0511 commit c924027
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ checked-out files, the other containers will have access as well.
2. `inside-docker-container> bin/setup # installs all gems`
3. `inside-docker-container> bin/rake # runs all tests`

You can also try using `bin/ci` on your computer (not inside a Docker container), which will run tests across the entire build
matrix.

#### If You Want To Use Your Local Computer

In theory, GLI can be worked on using RVM, RBEnv, asdf, or whatever other way you want to manage Ruby. You can create a
Expand Down
36 changes: 12 additions & 24 deletions bin/ci
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
#!/bin/bash

set -e
if [ -z $1 ]; then
echo "[bin/ci] Running with default warnings"
export RUBYOPT=
else
if [ $1 == 'warnings' ]; then
echo "[bin/ci] Running with all warnings on"
export RUBYOPT=-w
else
if [ $1 == 'none' ]; then
echo "[bin/ci] Running with all warnings off"
export RUBYOPT='-W0'
else
echo "[bin/ci] '$1' is not a supported option"
echo "[bin/ci] usage: $0 # run with default warnings"
echo "[bin/ci] usage: $0 warnings # run with all warnings"
echo "[bin/ci] usage: $0 none # run with warnings disabled"
exit 1
fi
fi
fi

echo "[bin/ci] Running unit tests"
bin/rake test:unit
SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
DX_DIR="${SCRIPT_DIR}/../dx"

. "${DX_DIR}/docker-compose.env"
. "${DX_DIR}/setupkit.sh.lib"

for ruby_version in ${RUBY_VERSIONS[@]}; do
log "Setting up for Ruby version '${ruby_version}'"
dx/exec -v ${ruby_version} bin/setup
log "Running tests for Ruby version '${ruby_version}'"
dx/exec -v ${ruby_version} bin/rake
done

echo "[bin/ci] Running integration tests"
bin/rake test:integration

0 comments on commit c924027

Please sign in to comment.