ci: generate all matrices in a single step/job
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
parent
7d47070d99
commit
2dc5a4e943
|
@ -117,9 +117,7 @@ def get_jobs(
|
|||
|
||||
return jobs
|
||||
|
||||
distribution = environ['F4PGA_EXAMPLES_DISTRIBUTION']
|
||||
jobs = get_jobs(distribution, False) + get_jobs(distribution, True)
|
||||
|
||||
print(f'::set-output name=matrix::{jobs!s}')
|
||||
|
||||
print(str(jobs))
|
||||
for distribution in ['debian', 'ubuntu', 'fedora', 'centos']:
|
||||
jobs = get_jobs(distribution, False) + get_jobs(distribution, True)
|
||||
print(f'::set-output name={distribution}::{jobs!s}')
|
||||
print(f"{distribution}: {jobs!s}")
|
|
@ -14,23 +14,43 @@ on:
|
|||
jobs:
|
||||
|
||||
|
||||
Debian:
|
||||
Matrices:
|
||||
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
debian: ${{ steps.generate.outputs.debian }}
|
||||
ubuntu: ${{ steps.generate.outputs.ubuntu }}
|
||||
fedora: ${{ steps.generate.outputs.fedora }}
|
||||
centos: ${{ steps.generate.outputs.centos }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: generate
|
||||
run: ./.github/scripts/generate_job_matrices.py '${{ github.repository }}'
|
||||
|
||||
|
||||
Debian:
|
||||
needs: Matrices
|
||||
uses: ./.github/workflows/sphinx-tuttest.yml
|
||||
with:
|
||||
distribution: debian
|
||||
matrix: ${{ needs.Matrices.outputs.debian }}
|
||||
|
||||
Ubuntu:
|
||||
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
|
||||
needs: Matrices
|
||||
uses: ./.github/workflows/sphinx-tuttest.yml
|
||||
with:
|
||||
distribution: ubuntu
|
||||
matrix: ${{ needs.Matrices.outputs.ubuntu }}
|
||||
|
||||
Fedora:
|
||||
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
|
||||
needs: Matrices
|
||||
uses: ./.github/workflows/sphinx-tuttest.yml
|
||||
with:
|
||||
distribution: fedora
|
||||
matrix: ${{ needs.Matrices.outputs.fedora }}
|
||||
|
||||
Centos:
|
||||
needs: Matrices
|
||||
uses: ./.github/workflows/sphinx-tuttest.yml
|
||||
with:
|
||||
matrix: ${{ needs.Matrices.outputs.centos }}
|
||||
|
||||
|
||||
Automerge:
|
||||
|
@ -38,6 +58,7 @@ jobs:
|
|||
- Debian
|
||||
- Ubuntu
|
||||
- Fedora
|
||||
- Centos
|
||||
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
name: Automerge dependabot PRs
|
||||
|
|
|
@ -3,7 +3,7 @@ name: doc-test
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distribution:
|
||||
matrix:
|
||||
description: 'Distribution to execute tests on'
|
||||
required: true
|
||||
type: string
|
||||
|
@ -11,31 +11,11 @@ on:
|
|||
jobs:
|
||||
|
||||
|
||||
Matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.generate.outputs.matrix }}
|
||||
surelog-matrix: ${{ steps.generate-surelog.outputs.matrix }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Setup repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Generate examples matrix
|
||||
id: generate
|
||||
run: >-
|
||||
F4PGA_EXAMPLES_DISTRIBUTION='${{ inputs.distribution }}'
|
||||
./.github/scripts/generate_job_matrix.py
|
||||
'${{ github.repository }}'
|
||||
|
||||
|
||||
Test:
|
||||
needs: Matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
|
||||
include: ${{ fromJson(inputs.matrix) }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
name: ${{ matrix.os-version }} | ${{ matrix.name }} | ${{ matrix.fpga-fam }} | ${{ matrix.example }}
|
||||
|
||||
|
|
Loading…
Reference in New Issue