From 8adb9a9ca647460eefa83ea1a484a5cbdc71d103 Mon Sep 17 00:00:00 2001 From: Patrik Ragnarsson Date: Tue, 20 Jan 2026 18:26:50 +0100 Subject: [PATCH] CI on GitHub Actions --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ .travis.yml | 8 -------- Gemfile | 6 ++---- bin/setup-deps | 27 +++++++++++++++++++++++++++ geminstaller.yml | 4 ---- 5 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100755 bin/setup-deps delete mode 100644 geminstaller.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6415277 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + ruby-version: + - '3.0' + - '3.1' + - '3.2' + - '3.3' + - '3.4' + + steps: + - uses: actions/checkout@v6 + - run: ./bin/setup-deps + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - run: bundle exec rake spec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 189eb00..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -language: ruby -rvm: - - 2.3.4 - - 2.4.1 -sudo: false -cache: bundler - diff --git a/Gemfile b/Gemfile index 74dbfa4..cc0e68d 100644 --- a/Gemfile +++ b/Gemfile @@ -14,10 +14,8 @@ end group :test do gem 'rspec', ">=3.0" - gem 'wrong', path: "../wrong" - gem 'files', path: "../files" - # gem 'wrong', github: "alexch/wrong" - # gem 'files', github: "alexch/files" + gem 'wrong', path: "tmp/wrong" + gem 'files', path: "tmp/files" end gem 'wdm', '>= 0.1.0' if Gem.win_platform? diff --git a/bin/setup-deps b/bin/setup-deps new file mode 100755 index 0000000..0b759a3 --- /dev/null +++ b/bin/setup-deps @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +cd "$(dirname "$0")/.." + +mkdir -p tmp + +echo "at=info msg=\"checking out test dependencies\"" + +if [ -d "tmp/wrong" ]; then + echo "at=info msg=\"wrong already exists, pulling latest\"" + git -C tmp/wrong pull +else + echo "at=info msg=\"cloning wrong\"" + git clone https://github.com/alexch/wrong.git tmp/wrong + rm -f tmp/wrong/wrong-java.gemspec +fi + +if [ -d "tmp/files" ]; then + echo "at=info msg=\"files already exists, pulling latest\"" + git -C tmp/files pull +else + echo "at=info msg=\"cloning files\"" + git clone https://github.com/alexch/files.git tmp/files +fi + +echo "at=info msg=\"dependencies ready\"" diff --git a/geminstaller.yml b/geminstaller.yml deleted file mode 100644 index 4e8a211..0000000 --- a/geminstaller.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -gems: -- name: rspec - version: '>= 1.2.6'