From c072128fdd255f1701010a81368e9300ef93950c Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 16 Jul 2020 14:13:28 +0200 Subject: [PATCH 01/14] First version of GitHub Actions based CI --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30afa08 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + rspec: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + ruby: + - 2.7 + - 2.6 + - 2.5 + - 2.4 + - 2.3 + - 2.2 + - 2.1 + - head + + - jruby-9.1 + - jruby-9.2 + - jruby-head + + - truffleruby + - truffleruby-head + include: + - ruby: 2.1 + bundler-version: 1 + - ruby: 2.2 + bundler-version: 1 + + continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'truffleruby' }} + + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-version: ${{ matrix.bundler-version || '2' }} + bundler-cache: true + + - name: rspec + run: bundle exec rspec From 8e3db6a7defd6f3d0ad84f85ac267062bcf01944 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 16 Jul 2020 14:19:35 +0200 Subject: [PATCH 02/14] Remove Rub y 2.1 from github workflow CI --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30afa08..25a49e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,6 @@ jobs: - 2.4 - 2.3 - 2.2 - - 2.1 - head - jruby-9.1 @@ -34,11 +33,6 @@ jobs: - truffleruby - truffleruby-head - include: - - ruby: 2.1 - bundler-version: 1 - - ruby: 2.2 - bundler-version: 1 continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'truffleruby' }} @@ -49,7 +43,6 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - bundler-version: ${{ matrix.bundler-version || '2' }} bundler-cache: true - name: rspec From 4027f78308d97ff5ff5e89de0b938a33a2e707de Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 16 Jul 2020 15:00:26 +0200 Subject: [PATCH 03/14] Re-add Ruby 2.1 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25a49e2..7a69406 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: - 2.4 - 2.3 - 2.2 + - 2.1 - head - jruby-9.1 @@ -40,7 +41,7 @@ jobs: - uses: actions/checkout@v2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: meineerde/setup-ruby@feature/ruby-2.1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 36e2bdbcc5b6d0878ed5c22131db0f4aa59cd7a1 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 16 Jul 2020 15:00:59 +0200 Subject: [PATCH 04/14] Temporarily run only on Ubuntu and Windows --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a69406..13f2a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, windows-latest] ruby: - 2.7 - 2.6 @@ -35,7 +35,8 @@ jobs: - truffleruby - truffleruby-head - continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'truffleruby' }} + # continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'truffleruby' }} + continue-on-error: true steps: - uses: actions/checkout@v2 From 654f4a61bb6f840df4a6cc1ff8f27bbe45359ded Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 16 Jul 2020 20:56:34 +0200 Subject: [PATCH 05/14] re-enable macos-latest --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13f2a68..fbf20fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] ruby: - 2.7 - 2.6 From 649ba110b0bc7a224cac1df0132dcb491cfa4496 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:40:20 +0200 Subject: [PATCH 06/14] Use upstream ruby/setup-ruby workflow again --- .github/workflows/ci.yml | 51 ------------------------------------- .github/workflows/test.yml | 52 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index fbf20fd..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - rspec: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - ruby: - - 2.7 - - 2.6 - - 2.5 - - 2.4 - - 2.3 - - 2.2 - - 2.1 - - head - - - jruby-9.1 - - jruby-9.2 - - jruby-head - - - truffleruby - - truffleruby-head - - # continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'truffleruby' }} - continue-on-error: true - - steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: meineerde/setup-ruby@feature/ruby-2.1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - - name: rspec - run: bundle exec rspec diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7b8b5b4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: rspec + +on: + pull_request: + push: + tags-ignore: + - '*' + paths-ignore: + - README.md + - CHANGELOG.md + schedule: + - cron: '0 7 * * SUN' + +jobs: + rspec: + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos, windows] + ruby: + - 2.7 + - 2.6 + - 2.5 + - 2.4 + - 2.3 + - 2.2 + - 2.1 + - head + + - jruby-9.1 + - jruby-9.2 + - jruby-head + + - truffleruby + - truffleruby-head + include: + ruby: 2.7 + env: COVERAGE=1 + + runs-on: ${{ matrix.os }}-latest + continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} + + steps: + - uses: actions/checkout@v2 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: ruby -v + + - run: bundle exec rspec From 3d6704e3322c5292c2c703901f9b678465c8faf1 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:40:56 +0200 Subject: [PATCH 07/14] Initial rubocop checks --- .github/config/rubocop.yml | 47 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 11 +++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/config/rubocop.yml diff --git a/.github/config/rubocop.yml b/.github/config/rubocop.yml new file mode 100644 index 0000000..63159a9 --- /dev/null +++ b/.github/config/rubocop.yml @@ -0,0 +1,47 @@ +# Description: The name of the check that will be created. +# Valid Options: A reasonably sized string. +# Default: 'Rubocop Action' +check_name: 'Rubocop Results' + +# Description: Versions required to run your RuboCop checks. +# Valid options: RuboCop and any RuboCop extension, by default the latest gem version will be used. You can explicitly state that +# (not required) or use a version number, like '1.5.1'. +# Default: +# versions: +# - rubocop: 'latest' +versions: + - rubocop + - rubocop-performamce + - rubocop-rspec + +# Description: Rubocop configuration file path relative to the workspace. +# Valid options: A valid file path inside of the workspace. +# Default: nil +# Note: This does not need to be filled out for Rubocop to still find your config. +# Resource: https://rubocop.readthedocs.io/en/stable/configuration/ +rubocop_config_path: '.rubocop.yml' + +# Run all cops enabled by configuration except this list. +# Valid options: list of valid cop(s) and/or departments. +# Default: nil +# Resource: https://rubocop.readthedocs.io/en/stable/cops/ +rubocop_excluded_cops: [] + +# Minimum severity for exit with error code +# Valid options: 'refactor', 'convention', 'warning', 'error', or 'fatal'. +# Default: 'warning' +# Resource: https://rubocop.readthedocs.io/en/stable/configuration/#severity +rubocop_fail_level: 'warning' + +# Instead of installing gems from rubygems, we can run `bundle install` on your project, +# you would need to do this if you are using something like 'rubocop-github' or if you don't +# want to list out dependencies with the `versions` key. +# Valid options: true || false +# Default: false +bundle: false + +# The scope of code that Rubocop should lint. Use this if you only want to lint changed files. If this is not set +# or not equal to 'modified', Rubocop is run against the entire codebase. Note that this will not work on the master branch. +# Valid options: 'modified' +# Default: nil +check_scope: null diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b8b5b4..481ffaf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,3 +50,14 @@ jobs: - run: ruby -v - run: bundle exec rspec + + robucop: + runs-on: ubuntu-latest + + steps: + - name: Rubocop + uses: andrewmcodes/rubocop-linter-action@v3.2.0 + with: + action_config_path: '.github/actions/config/rubocop.yml' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c3a269d12ae14306984da5b324bb9094689ba071 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:43:15 +0200 Subject: [PATCH 08/14] fixes --- .github/workflows/test.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 481ffaf..13917c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,13 +18,13 @@ jobs: matrix: os: [ubuntu, macos, windows] ruby: - - 2.7 - - 2.6 - - 2.5 - - 2.4 - - 2.3 - - 2.2 - - 2.1 + - '2.7' + - '2.6' + - '2.5' + - '2.4' + - '2.3' + - '2.2' + - '2.1' - head - jruby-9.1 @@ -33,9 +33,11 @@ jobs: - truffleruby - truffleruby-head - include: - ruby: 2.7 - env: COVERAGE=1 + + include: + - ruby: '2.7' + env: + COVERAGE: '1' runs-on: ${{ matrix.os }}-latest continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} @@ -58,6 +60,6 @@ jobs: - name: Rubocop uses: andrewmcodes/rubocop-linter-action@v3.2.0 with: - action_config_path: '.github/actions/config/rubocop.yml' + action_config_path: '.github/config/rubocop.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bbff6b775150f90c8234edb57ea1acc1e15aeb00 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:51:12 +0200 Subject: [PATCH 09/14] Better build environment info --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13917c9..af08d42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,9 +49,14 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - run: ruby -v - - run: bundle exec rspec + - name: Check Ruby version + run: | + ruby -v + bundle --version + + - name: Run rspec + run: bundle exec rspec robucop: runs-on: ubuntu-latest From a3199da85c63760e7d7811e2cb5b75aa45dd08cd Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:55:01 +0200 Subject: [PATCH 10/14] meh --- .github/workflows/test.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af08d42..1b9f4ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,11 +50,6 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Check Ruby version - run: | - ruby -v - bundle --version - - name: Run rspec run: bundle exec rspec From 428557e488452767f327c6d284bd03ac53e0d1c1 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 13:58:28 +0200 Subject: [PATCH 11/14] How about now? --- .github/config/{rubocop.yml => rubocop_linter_action.yml} | 0 .github/workflows/test.yml | 2 -- 2 files changed, 2 deletions(-) rename .github/config/{rubocop.yml => rubocop_linter_action.yml} (100%) diff --git a/.github/config/rubocop.yml b/.github/config/rubocop_linter_action.yml similarity index 100% rename from .github/config/rubocop.yml rename to .github/config/rubocop_linter_action.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b9f4ac..dbd8a05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,5 @@ jobs: steps: - name: Rubocop uses: andrewmcodes/rubocop-linter-action@v3.2.0 - with: - action_config_path: '.github/config/rubocop.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b8f27ee95cd5a664446e4a8b03b66f946b28735b Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 14:01:21 +0200 Subject: [PATCH 12/14] Now with checkout --- .github/config/{rubocop_linter_action.yml => rubocop.yml} | 0 .github/workflows/test.yml | 4 ++++ 2 files changed, 4 insertions(+) rename .github/config/{rubocop_linter_action.yml => rubocop.yml} (100%) diff --git a/.github/config/rubocop_linter_action.yml b/.github/config/rubocop.yml similarity index 100% rename from .github/config/rubocop_linter_action.yml rename to .github/config/rubocop.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbd8a05..29cd433 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,11 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Rubocop uses: andrewmcodes/rubocop-linter-action@v3.2.0 + with: + action_config_path: '.github/config/rubocop.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ba845357ffc155791ff4e2c942707ca4185c76fa Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 14:03:47 +0200 Subject: [PATCH 13/14] typo --- .github/config/rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/config/rubocop.yml b/.github/config/rubocop.yml index 63159a9..d4f60c7 100644 --- a/.github/config/rubocop.yml +++ b/.github/config/rubocop.yml @@ -11,7 +11,7 @@ check_name: 'Rubocop Results' # - rubocop: 'latest' versions: - rubocop - - rubocop-performamce + - rubocop-performance - rubocop-rspec # Description: Rubocop configuration file path relative to the workspace. From f09fe11b888b72a840df88e21f14300dcab43329 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 17 Jul 2020 14:06:03 +0200 Subject: [PATCH 14/14] Separate test and linter workflows --- .github/config/rubocop.yml | 2 +- .github/workflows/linter.yml | 24 ++++++++++++++++++++++++ .github/workflows/test.yml | 13 ------------- 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/linter.yml diff --git a/.github/config/rubocop.yml b/.github/config/rubocop.yml index d4f60c7..d1375a8 100644 --- a/.github/config/rubocop.yml +++ b/.github/config/rubocop.yml @@ -44,4 +44,4 @@ bundle: false # or not equal to 'modified', Rubocop is run against the entire codebase. Note that this will not work on the master branch. # Valid options: 'modified' # Default: nil -check_scope: null +# check_scope: 'modified' diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..55fc2df --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,24 @@ +name: linter + +on: + pull_request: + push: + tags-ignore: + - '*' + paths-ignore: + - README.md + - CHANGELOG.md + +jobs: + robucop: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Rubocop + uses: andrewmcodes/rubocop-linter-action@v3.2.0 + with: + action_config_path: '.github/config/rubocop.yml' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29cd433..9b41536 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,16 +52,3 @@ jobs: - name: Run rspec run: bundle exec rspec - - robucop: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Rubocop - uses: andrewmcodes/rubocop-linter-action@v3.2.0 - with: - action_config_path: '.github/config/rubocop.yml' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}