Skip to content

Commit 1cfbb45

Browse files
committed
parallelize tests on GHA
1 parent 8bd953d commit 1cfbb45

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/foreman.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ jobs:
2020
- name: Build test matrix
2121
id: build_matrix
2222
uses: theforeman/gha-matrix-builder@v0
23-
test:
24-
name: "Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }} on PostgreSQL ${{ matrix.postgresql }}"
23+
24+
tests:
25+
name: "${{ matrix.task }} - Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }} on PostgreSQL ${{ matrix.postgresql }}"
2526
runs-on: ubuntu-latest
2627
needs: setup_matrix
2728
services:
@@ -33,7 +34,14 @@ jobs:
3334
POSTGRES_PASSWORD: password
3435
strategy:
3536
fail-fast: false
36-
matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }}
37+
matrix:
38+
ruby: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby }}
39+
node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }}
40+
postgresql: ${{ fromJson(needs.setup_matrix.outputs.matrix).postgresql }}
41+
task:
42+
- 'test:units'
43+
- 'test:functionals'
44+
- 'test:graphql'
3745
steps:
3846
- run: sudo apt-get update
3947
- run: sudo apt-get -qq -y install build-essential libcurl4-openssl-dev zlib1g-dev libpq-dev libvirt-dev
@@ -57,9 +65,12 @@ jobs:
5765
run: |
5866
bundle exec rake db:create
5967
bundle exec rake db:migrate
60-
- name: Run unit tests
61-
run: bundle exec rake test:units
62-
- name: Run functional tests
63-
run: bundle exec rake test:functionals
64-
- name: Run graphql tests
65-
run: bundle exec rake test:graphql
68+
- name: Run rake ${{ matrix.task }}
69+
run: bundle exec rake ${{ matrix.task }}
70+
71+
result:
72+
name: Test suite
73+
runs-on: ubuntu-latest
74+
needs: tests
75+
steps:
76+
- run: echo Test suite completed

0 commit comments

Comments
 (0)