From a92038f71b119f5697d810a7640a566d5ad66ece Mon Sep 17 00:00:00 2001 From: Bobby McDonald Date: Mon, 7 Dec 2020 14:29:32 -0500 Subject: Create initial action --- .github/workflows/main.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..014f927 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,64 @@ +name: Ruby + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + danger: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.7' + - uses: MeilCli/danger-action@v5 + with: + plugins_file: 'Gemfile' + install_path: 'vendor/bundle' + danger_file: 'Dangerfile' + danger_id: 'danger-pr' + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.github_token }} + test: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + ruby: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, head, debug, truffleruby, truffleruby-head] + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Install dependencies + run: bundle install + - name: Run tests + run: bundle exec rake + test-jruby: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos] + jruby: [jruby, jruby-head] + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.jruby }} + bundler-cache: true + - name: Install dependencies + env: + JRUBY_OPTS: --debug + run: bundle install + - name: Run tests + env: + JRUBY_OPTS: --debug + run: bundle exec rake -- cgit v1.2.1 From 2b7c893cbb7af25b9c1aff0eb5d9a83b3bf1053d Mon Sep 17 00:00:00 2001 From: Bobby McDonald Date: Mon, 7 Dec 2020 15:37:46 -0500 Subject: Remove travis.yml --- .travis.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 49230a1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: ruby -cache: bundler - -rvm: - - 2.6 - - 2.5 - - 2.4 - - 2.3 - - 2.2 - - 2.1 - - ruby-head - - jruby-9.2.11.1 - - jruby-head - - truffleruby - -matrix: - fast_finish: true - include: - - rvm: 2.7 - name: "Ruby: 2.7 (with Danger and Code Climate)" - before_script: - - bundle exec danger - after_script: - - bundle exec codeclimate-test-reporter - - rvm: 2.7 - name: "Integration Tests" - install: - - for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle; done - script: - - set -e ; for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle exec rspec $dir; done - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - - rvm: truffleruby -- cgit v1.2.1 From da421967765e7766136f2547b4074043f957c297 Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Sun, 27 Jun 2021 22:24:40 -0500 Subject: Remove mention and configuration of CodeClimate We don't really care about the metrics it gives and we can't access configuration for it anymore for some reason, so let's end it. --- Gemfile | 2 +- README.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 103f64a..7edd0a4 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ group :development do end group :test do - gem 'codeclimate-test-reporter', '~> 1.0', require: false gem 'danger-changelog', '~> 0.6.1', require: false gem 'danger-toc', '~> 0.2.0', require: false + gem 'simplecov' end diff --git a/README.md b/README.md index 3ad96b1..38f7f81 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![Join the chat at https://gitter.im/hashie/hashie](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hashie/hashie?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Gem Version](http://img.shields.io/gem/v/hashie.svg)](http://badge.fury.io/rb/hashie) [![Build Status](http://img.shields.io/travis/hashie/hashie.svg)](https://travis-ci.org/hashie/hashie) -[![Test Coverage](https://api.codeclimate.com/v1/badges/7a0b42c8a22c945571fd/test_coverage)](https://codeclimate.com/github/hashie/hashie/test_coverage) -[![Maintainability](https://api.codeclimate.com/v1/badges/7a0b42c8a22c945571fd/maintainability)](https://codeclimate.com/github/hashie/hashie/maintainability) [![eierlegende Wollmilchsau](./mascot.svg)](#mascot) Hashie is a growing collection of tools that extend Hashes and make them more useful. -- cgit v1.2.1 From e8819816be56e92e583f09a33e48a39ae51e85fd Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Sun, 27 Jun 2021 22:26:11 -0500 Subject: Lint the CI configuration and update badge Using YAML lists over pseudo-JSON lists makes for easier diffs. Breaking blocks apart with an empty line helps readability. Avoiding strings delimeters when you don't need them helps with readability. The name of the workflow should describe its purpose. Multithreading bundle installs leads to faster builds. And we need to update the badge to our new CI location. --- .github/workflows/main.yml | 50 +++++++++++++++++++++++++++++----------------- README.md | 2 +- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 014f927..3ddc090 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,63 +1,77 @@ -name: Ruby +name: CI on: push: - branches: [ master ] + branches: + - master pull_request: - branches: [ master ] + branches: + - master jobs: danger: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + if: ${{ github.event_name == 'pull_request' }} steps: - uses: actions/checkout@v2 - uses: actions/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: 2.7 - uses: MeilCli/danger-action@v5 with: - plugins_file: 'Gemfile' - install_path: 'vendor/bundle' - danger_file: 'Dangerfile' - danger_id: 'danger-pr' + danger_file: Dangerfile + danger_id: danger-pr + install_path: vendor/bundle + plugins_file: Gemfile env: DANGER_GITHUB_API_TOKEN: ${{ secrets.github_token }} + test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - ruby: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, head, debug, truffleruby, truffleruby-head] + ruby: + - 2.7 + - 2.6 + - 2.5 + - 2.4 + - 2.3 + - 2.2 + - 2.1 steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} bundler-cache: true + ruby-version: ${{ matrix.ruby }} - name: Install dependencies - run: bundle install + run: bundle install --jobs 4 --retry 3 - name: Run tests run: bundle exec rake + test-jruby: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: [ubuntu, macos] - jruby: [jruby, jruby-head] + os: + - macos + - ubuntu + jruby: + - jruby steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.jruby }} bundler-cache: true + ruby-version: ${{ matrix.jruby }} - name: Install dependencies env: JRUBY_OPTS: --debug - run: bundle install + run: bundle install --jobs 4 --retry 3 - name: Run tests env: JRUBY_OPTS: --debug diff --git a/README.md b/README.md index 38f7f81..ea38d9f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Join the chat at https://gitter.im/hashie/hashie](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hashie/hashie?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Gem Version](http://img.shields.io/gem/v/hashie.svg)](http://badge.fury.io/rb/hashie) -[![Build Status](http://img.shields.io/travis/hashie/hashie.svg)](https://travis-ci.org/hashie/hashie) +[![Build Status](https://github.com/hashie/hashie/actions/workflows/main.yml/badge.svg)](https://github.com/hashie/hashie/actions/workflows/main.yml) [![eierlegende Wollmilchsau](./mascot.svg)](#mascot) Hashie is a growing collection of tools that extend Hashes and make them more useful. -- cgit v1.2.1 From 9e7497c3468b62d5fc02e2cb62e58083fbc389be Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Sun, 27 Jun 2021 22:28:00 -0500 Subject: Add integration tests to CI harness We want to make sure none of our popular downstream integrations break. This ports our old Travis setup over to GitHub Actions. --- .github/workflows/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ddc090..5149d9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,23 @@ jobs: env: DANGER_GITHUB_API_TOKEN: ${{ secrets.github_token }} + integration-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: 2.7 + - name: Run integration tests + run: | + for dir in spec/integration/*; do + echo "testing $dir integration" + BUNDLE_GEMFILE=$dir/Gemfile bundle install --jobs 4 --retry 3 + BUNDLE_GEMFILE=$dir/Gemfile bundle exec rspec $dir + done + test: runs-on: ubuntu-latest strategy: -- cgit v1.2.1 From 509865dfc2bd17685988627bf07e21982a8e50e9 Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Sun, 27 Jun 2021 22:42:43 -0500 Subject: Track Omniauth official releases This was always meant to be a temporary fix. Let's track actual releases because GitHub Actions is choking on it. --- spec/integration/omniauth-oauth2/Gemfile | 4 +--- spec/integration/omniauth/Gemfile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/integration/omniauth-oauth2/Gemfile b/spec/integration/omniauth-oauth2/Gemfile index c081df6..91c3c2a 100644 --- a/spec/integration/omniauth-oauth2/Gemfile +++ b/spec/integration/omniauth-oauth2/Gemfile @@ -1,9 +1,7 @@ source 'http://rubygems.org' gem 'hashie', path: '../../..' -# Update omniauth to a pessimistic minor once omniauth releases changes in -# https://github.com/omniauth/omniauth/pull/977 -gem 'omniauth', git: 'https://github.com/omniauth/omniauth.git', branch: 'master' +gem 'omniauth' gem 'omniauth-oauth2', '~> 1.4.0' gem 'rails', '~> 5.0.1' gem 'rspec', '~> 3.5.0' diff --git a/spec/integration/omniauth/Gemfile b/spec/integration/omniauth/Gemfile index a29245b..af40e06 100644 --- a/spec/integration/omniauth/Gemfile +++ b/spec/integration/omniauth/Gemfile @@ -2,9 +2,7 @@ source 'http://rubygems.org' gem 'benchmark-ips' gem 'hashie', path: '../../..' -# Update omniauth to a pessimistic minor once https://github.com/omniauth/omniauth/issues/980 -# is resolved. -gem 'omniauth', git: 'https://github.com/omniauth/omniauth.git', branch: 'master' +gem 'omniauth' gem 'rack-test', '~> 0.6.3' gem 'rake' gem 'rspec', '~> 3.5.0' -- cgit v1.2.1