From 85a4a655cd1823ba2e642239dbd5be8fd4cea3b0 Mon Sep 17 00:00:00 2001 From: schneems Date: Sun, 31 Jul 2022 11:22:20 -0500 Subject: [PATCH] Move tests to GithubActions All tests ported except for YJIT ``` - run: echo "export RUBY_YJIT_ENABLE=1" >> $BASH_ENV ``` --- .circleci/config.yml | 91 ---------------------------------------- .github/workflows/ci.yml | 44 +++++++++++++++++++ Rakefile | 1 + 3 files changed, 45 insertions(+), 91 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0c842bd..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,91 +0,0 @@ -version: 2.1 -orbs: - ruby: circleci/ruby@1.8.0 -references: - unit: &unit - run: - name: Run test suite - command: bundle exec rspec spec/ - - lint: &lint - run: - name: Run linter, fix with `standardrb --fix` locally - command: bundle exec standardrb - -jobs: - "ruby-2-5": - docker: - - image: circleci/ruby:2.5 - steps: - - checkout - - ruby/install-deps - - <<: *unit - - "ruby-2-6": - docker: - - image: circleci/ruby:2.6 - steps: - - checkout - - ruby/install-deps - - <<: *unit - - "ruby-2-7": - docker: - - image: circleci/ruby:2.7 - steps: - - checkout - - ruby/install-deps - - <<: *unit - - "ruby-3-0": - docker: - - image: circleci/ruby:3.0 - steps: - - checkout - - ruby/install-deps - - <<: *unit - - "ruby-3-1": - docker: - - image: 'cimg/ruby:3.1' - steps: - - checkout - - ruby/install-deps - - <<: *unit - - "ruby-3-2": - docker: - - image: 'ruby:3.2.0-preview1' - steps: - - checkout - - ruby/install-deps - - <<: *unit - "ruby-3-2-yjit": - docker: - - image: 'ruby:3.2.0-preview1' - steps: - - run: echo "export RUBY_YJIT_ENABLE=1" >> $BASH_ENV - - checkout - - ruby/install-deps - - <<: *unit - - "lint": - docker: - - image: circleci/ruby:3.0 - steps: - - checkout - - ruby/install-deps - - <<: *lint - -workflows: - version: 2 - build: - jobs: - - "ruby-2-5" - - "ruby-2-6" - - "ruby-2-7" - - "ruby-3-0" - - "ruby-3-1" - - "ruby-3-2" - - "ruby-3-2-yjit" - - "lint" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c1b3e32 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + - push + - pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1 + bundler-cache: true + - name: Linting + run: bundle exec standardrb + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - 2.5 + - 2.6 + - 2.7 + - '3.0' + - 3.1 + - "3.2.0-preview1" + - head + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: test + run: bundle exec rake test + continue-on-error: ${{ matrix.ruby == 'head' }} diff --git a/Rakefile b/Rakefile index b6ae734..466e3a1 100644 --- a/Rakefile +++ b/Rakefile @@ -6,3 +6,4 @@ require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task default: :spec +task test: :spec