From 1cfbb451f3e0b52408cafee6e8efdfe845ac2128 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 24 Nov 2023 09:19:01 +0100 Subject: [PATCH] parallelize tests on GHA --- .github/workflows/foreman.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/foreman.yml b/.github/workflows/foreman.yml index b6507a6dddc..33732cc4c0d 100644 --- a/.github/workflows/foreman.yml +++ b/.github/workflows/foreman.yml @@ -20,8 +20,9 @@ jobs: - name: Build test matrix id: build_matrix uses: theforeman/gha-matrix-builder@v0 - test: - name: "Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }} on PostgreSQL ${{ matrix.postgresql }}" + + tests: + name: "${{ matrix.task }} - Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }} on PostgreSQL ${{ matrix.postgresql }}" runs-on: ubuntu-latest needs: setup_matrix services: @@ -33,7 +34,14 @@ jobs: POSTGRES_PASSWORD: password strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }} + matrix: + ruby: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby }} + node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }} + postgresql: ${{ fromJson(needs.setup_matrix.outputs.matrix).postgresql }} + task: + - 'test:units' + - 'test:functionals' + - 'test:graphql' steps: - run: sudo apt-get update - run: sudo apt-get -qq -y install build-essential libcurl4-openssl-dev zlib1g-dev libpq-dev libvirt-dev @@ -57,9 +65,12 @@ jobs: run: | bundle exec rake db:create bundle exec rake db:migrate - - name: Run unit tests - run: bundle exec rake test:units - - name: Run functional tests - run: bundle exec rake test:functionals - - name: Run graphql tests - run: bundle exec rake test:graphql + - name: Run rake ${{ matrix.task }} + run: bundle exec rake ${{ matrix.task }} + + result: + name: Test suite + runs-on: ubuntu-latest + needs: tests + steps: + - run: echo Test suite completed