GHA: refactor repeating steps in pipeline #189
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
python-versions: ${{ steps.generate-matrix.outputs.PYTHONS }} | |
rf-versions: ${{ steps.generate-matrix.outputs.RF_VERSIONS }} | |
steps: | |
- name: "Generate Matrix" | |
id: generate-matrix | |
run: | | |
echo 'PYTHONS=["3.10.11", "3.11.6", "3.12.0"]' >> $GITHUB_OUTPUT | |
echo 'RF_VERSIONS=["3.2.2", "4.1.3", "5.0.1", "6.1.1"]' >> $GITHUB_OUTPUT | |
windows: | |
runs-on: windows-latest | |
needs: | |
- generate-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ${{ fromJSON(needs.generate-matrix.outputs.python-versions) }} | |
rf-version: ${{ fromJSON(needs.generate-matrix.outputs.rf-versions) }} | |
name: Windows (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Run tests | |
uses: ./.github/workflows/run-tests | |
with: | |
python-version: ${{ matrix.python }} | |
rf-version: ${{ matrix.rf-version }} | |
terminal: "pwsh" | |
linux: | |
runs-on: ubuntu-latest | |
needs: | |
- generate-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ${{ fromJSON(needs.generate-matrix.outputs.python-versions) }} | |
rf-version: ${{ fromJSON(needs.generate-matrix.outputs.rf-versions) }} | |
name: Linux (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Run tests | |
uses: ./.github/workflows/run-tests | |
with: | |
python-version: ${{ matrix.python }} | |
rf-version: ${{ matrix.rf-version }} | |
terminal: "bash" | |
macos: | |
runs-on: macos-latest | |
needs: | |
- generate-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ${{ fromJSON(needs.generate-matrix.outputs.python-versions) }} | |
rf-version: ${{ fromJSON(needs.generate-matrix.outputs.rf-versions) }} | |
name: MacOS (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Run tests | |
uses: ./.github/workflows/run-tests | |
with: | |
python-version: ${{ matrix.python }} | |
rf-version: ${{ matrix.rf-version }} | |
terminal: "bash" |