Skip to content

Commit

Permalink
parallelize tests on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 24, 2023
1 parent 8bd953d commit 1cfbb45
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/foreman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 1cfbb45

Please sign in to comment.