Merge pull request #198 from umarcor/ci/matrix

ci: generate job matrix through a Python script
This commit is contained in:
Karol Gugala 2021-10-20 12:10:10 +02:00 committed by GitHub
commit 848291da54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 81 deletions

42
.github/scripts/generate_job_matrix.py vendored Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env python3
examples = [
"counter",
"picosoc",
"litex",
"litex_linux",
"button_controller",
"pulse_width_led",
"timer",
"hello-a"
]
jobs = []
osvers = [
("ubuntu", "xenial"),
("ubuntu", "bionic"),
("ubuntu", "focal"),
("centos", "7"),
("centos", "8"),
("debian", "buster"),
("debian", "bullseye"),
("debian", "sid")
]
for osver in osvers:
jobs += [{
'fpga-fam': "xc7",
'os': osver[0],
'os-version': osver[1],
'example': example
} for example in examples]
jobs += [{
'fpga-fam': "eos-s3",
'os': osver[0],
'os-version': osver[1],
'example': "counter"
} for osver in osvers]
print('::set-output name=matrix::' + str(jobs))

View File

@ -7,92 +7,31 @@ on:
- cron: "0 0 * * *" - cron: "0 0 * * *"
jobs: jobs:
test:
Matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- name: Setup repository
uses: actions/checkout@v2
- name: Generate examples matrix
id: generate
run: ./.github/scripts/generate_job_matrix.py
Test:
needs: Matrix
runs-on: [self-hosted, Linux, X64] runs-on: [self-hosted, Linux, X64]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
- {fpga-fam: "eos-s3", os: "ubuntu", os-version: "xenial", example: "counter"}
- {fpga-fam: "eos-s3", os: "ubuntu", os-version: "bionic", example: "counter"}
- {fpga-fam: "eos-s3", os: "ubuntu", os-version: "focal", example: "counter"}
- {fpga-fam: "eos-s3", os: "centos", os-version: "7", example: "counter"}
- {fpga-fam: "eos-s3", os: "centos", os-version: "8", example: "counter"}
- {fpga-fam: "eos-s3", os: "debian", os-version: "buster", example: "counter"}
- {fpga-fam: "eos-s3", os: "debian", os-version: "bullseye", example: "counter"}
- {fpga-fam: "eos-s3", os: "debian", os-version: "sid", example: "counter"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "counter"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "counter"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "counter"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "counter"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "counter"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "counter"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "counter"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "counter"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "picosoc"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "picosoc"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "picosoc"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "picosoc"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "picosoc"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "picosoc"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "picosoc"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "picosoc"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "litex"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "litex"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "litex"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "litex"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "litex"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "litex"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "litex"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "litex"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "litex_linux"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "litex_linux"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "litex_linux"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "litex_linux"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "litex_linux"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "litex_linux"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "litex_linux"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "litex_linux"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "button_controller"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "button_controller"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "button_controller"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "button_controller"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "button_controller"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "button_controller"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "button_controller"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "button_controller"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "pulse_width_led"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "timer"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "timer"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "timer"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "timer"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "timer"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "timer"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "timer"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "timer"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "xenial", example: "hello-a"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "bionic", example: "hello-a"}
- {fpga-fam: "xc7", os: "ubuntu", os-version: "focal", example: "hello-a"}
- {fpga-fam: "xc7", os: "centos", os-version: "7", example: "hello-a"}
- {fpga-fam: "xc7", os: "centos", os-version: "8", example: "hello-a"}
- {fpga-fam: "xc7", os: "debian", os-version: "buster", example: "hello-a"}
- {fpga-fam: "xc7", os: "debian", os-version: "bullseye", example: "hello-a"}
- {fpga-fam: "xc7", os: "debian", os-version: "sid", example: "hello-a"}
env: env:
LANG: "en_US.UTF-8" LANG: "en_US.UTF-8"
DEBIAN_FRONTEND: "noninteractive" DEBIAN_FRONTEND: "noninteractive"