From 4784e9633edcd359bdf221dcf4913017a215d8f6 Mon Sep 17 00:00:00 2001 From: Aaron Lane <10655063+aaron-lane@users.noreply.github.com> Date: Sat, 21 Jan 2023 16:38:12 -0500 Subject: [PATCH] Fix up Delivery pipeline (#490) * Add missing parenthesis * Limit CodeQL analysis to Ruby 3.2 * Remove redundant pull request event trigger * Guard on NoMethodError from kitchen/rake_tasks * Add concurrency group * Fix name guard * Drop Ruby 3.2 from pipeline Need to understand why delegate throws NameError for =~ on Ruby 3.2 * Ignore vendor in CodeQL Co-authored-by: Aaron Lane <2400330-aaron-lane@users.noreply.gitlab.com> --- .github/codeql/config.yml | 2 ++ .github/workflows/delivery.yml | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .github/codeql/config.yml diff --git a/.github/codeql/config.yml b/.github/codeql/config.yml new file mode 100644 index 000000000..f18f377d1 --- /dev/null +++ b/.github/codeql/config.yml @@ -0,0 +1,2 @@ +paths-ignore: + - vendor diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml index ae2ca30ba..70dbc6a82 100644 --- a/.github/workflows/delivery.yml +++ b/.github/workflows/delivery.yml @@ -1,8 +1,9 @@ name: Delivery +concurrency: delivery-${{ github.ref }} + on: - push - - pull_request jobs: commit: @@ -16,7 +17,6 @@ jobs: - '2.7' - '3.0' - '3.1' - - '3.2' runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -28,23 +28,26 @@ jobs: bundler: '2.4' bundler-cache: true - name: Run RSpec Tests - if: ${{ matrix.ruby-version != '3.2' }} + if: ${{ matrix.ruby-version != '3.1' }} run: bundle exec rake test:rspec - name: Run RSpec Tests with Code Coverage - if: ${{ matrix.ruby-version == '3.2' }} + if: ${{ matrix.ruby-version == '3.1' }} uses: paambaati/codeclimate-action@v3.2.0 env: CC_TEST_REPORTER_ID: 7574433e1beed630cb9a171c688bb9e010d5028f00f7218d6e845fe138c65168 with: coverageCommand: bundle exec rake test:rspec - name: Initialize CodeQL + if: ${{ matrix.ruby-version == '3.1' }} uses: github/codeql-action/init@v2 with: + config-file: .github/codeql/config.yml languages: ruby - name: Perform CodeQL Analysis + if: ${{ matrix.ruby-version == '3.1' }} uses: github/codeql-action/analyze@v2 - name: Build Ruby Gem - if: ${{ matrix.ruby-version == '3.2' }} + if: ${{ matrix.ruby-version == '3.1' }} env: GEM_PRIVATE_KEY: ${{ secrets.GEM_PRIVATE_KEY }} run: | @@ -90,7 +93,6 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - # kitchen/rake_tasks raises a `NameError: undefined method `=~'` error on Ruby 3.2 ruby-version: '3.1' bundler: '2.4' bundler-cache: true @@ -122,7 +124,7 @@ jobs: release: name: "Release" - if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v' }} + if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3