ci: move matrix generation script to a file

Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
This commit is contained in:
umarcor 2021-10-20 00:05:37 +02:00
parent 42937545d5
commit 34e6234214
2 changed files with 46 additions and 39 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

@ -16,47 +16,12 @@ jobs:
steps: steps:
- name: Setup repository
uses: actions/checkout@v2
- name: Generate examples matrix - name: Generate examples matrix
id: generate id: generate
shell: python run: ./.github/scripts/generate_job_matrix.py
run: |
examples = [
"counter",
"picosoc",
"litex",
"litex_linux",
"button_controller",
"pulse_width_led",
"timer",
"hello-a"
]
osvers = [
("ubuntu", "xenial"),
("ubuntu", "bionic"),
("ubuntu", "focal"),
("centos", "7"),
("centos", "8"),
("debian", "buster"),
("debian", "bullseye"),
("debian", "sid")
]
jobs = []
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))
Test: Test: