Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish GH would allow include to create a new axis…

Copy link
Member Author

@evgeni evgeni Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if gha-matrix should gain a base-matrix param, which is used a base and then matrix.json is joined therein?

>>> import json
>>> base_matrix_input = '{"task":["a","b","c"]}'
>>> matrix_json = '{"ruby":["2.7","3.0"]}'
>>> matrix = json.loads(base_matrix_input)
>>> matrix.update(json.loads(matrix_json))
>>> matrix
{'task': ['a', 'b', 'c'], 'ruby': ['2.7', '3.0']}

- '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