From 6e25cefc46470cbe51c675c6690161dc785767d0 Mon Sep 17 00:00:00 2001 From: Jonathan Young Date: Tue, 10 Oct 2023 15:19:07 +0100 Subject: [PATCH] Parallelise MiniTest workflow This configures the MiniTest workflow to run using a matrix strategy. It run separate parts of the test suite on different nodes and hence speeds up total run time of the CI/CD pipeline. --- .github/workflows/minitest.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/minitest.yml b/.github/workflows/minitest.yml index 93d61a0fc9eb..ba1f1624a8b5 100644 --- a/.github/workflows/minitest.yml +++ b/.github/workflows/minitest.yml @@ -17,6 +17,14 @@ jobs: run-minitest: name: Run Minitest runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ci_node_index: [ + "test/unit/lib test/unit/app/helpers test/unit/app/presenters test/unit/app/validators test/unit/app/workers test/views", + "test/unit/app/models test/unit/app/services test/unit/app/uploaders test/unit/*_test.rb", + "test/functional test/components test/integration" + ] steps: - name: Setup MySQL id: setup-mysql @@ -65,4 +73,4 @@ jobs: RAILS_ENV: test GOVUK_CONTENT_SCHEMAS_PATH: vendor/publishing-api/content_schemas TEST_DATABASE_URL: ${{ steps.setup-mysql.outputs.db-url }} - run: bundle exec rake test + run: bundle exec rails test ${{ matrix.ci_node_index }}