From 0f03bf5debc51dcd780591a1eb944a4ae896f9e6 Mon Sep 17 00:00:00 2001 From: Christian Sutter Date: Thu, 31 Aug 2023 10:07:34 +0000 Subject: [PATCH] Improve CI Github Actions workflow - Give it the expected name ("CI") that downstream workflows expect - Change default Rake task to only run specs (and remove custom Rubocop Rake task) - Use `govuk-infrastructure` upstream workflows to run linting and Brakeman --- .github/workflows/ci.yml | 15 +++++++++++++-- Rakefile | 2 +- lib/tasks/rubocop.rake | 3 --- 3 files changed, 14 insertions(+), 6 deletions(-) delete mode 100644 lib/tasks/rubocop.rake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d143b64..ba1c376 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +name: CI + on: push: branches: @@ -9,8 +11,18 @@ on: description: 'The branch, tag or SHA to checkout' default: main type: string + jobs: - test: + lint-ruby: + name: Lint Ruby + uses: alphagov/govuk-infrastructure/.github/workflows/rubocop.yml@main + + security-analysis: + name: Security Analysis + uses: alphagov/govuk-infrastructure/.github/workflows/brakeman.yml@main + + test-ruby: + name: Test Ruby runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -20,4 +32,3 @@ jobs: with: bundler-cache: true - run: bin/rake - - run: bundle exec brakeman diff --git a/Rakefile b/Rakefile index 56d46c2..304a38a 100644 --- a/Rakefile +++ b/Rakefile @@ -5,4 +5,4 @@ require_relative "config/application" Rails.application.load_tasks -task default: %i[spec rubocop] +task default: %i[spec] diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake deleted file mode 100644 index 86bf404..0000000 --- a/lib/tasks/rubocop.rake +++ /dev/null @@ -1,3 +0,0 @@ -require "rubocop/rake_task" - -RuboCop::RakeTask.new