2021-10-19 18:05:37 -04:00
|
|
|
#!/usr/bin/env python3
|
2021-10-20 14:45:00 -04:00
|
|
|
#
|
|
|
|
# Copyright (C) 2021-2022 F4PGA Authors
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2021-10-19 18:05:37 -04:00
|
|
|
|
2022-06-15 19:01:05 -04:00
|
|
|
from os import environ
|
2021-12-14 03:21:51 -05:00
|
|
|
from sys import argv as sys_argv
|
|
|
|
|
2022-02-18 12:15:44 -05:00
|
|
|
isFork = len(sys_argv)>1 and sys_argv[1] != 'chipsalliance/f4pga-examples'
|
2021-12-14 22:32:15 -05:00
|
|
|
|
2021-12-14 03:21:51 -05:00
|
|
|
runs_on = (
|
|
|
|
'ubuntu-latest'
|
2021-12-14 22:32:15 -05:00
|
|
|
if isFork else
|
2021-12-14 03:21:51 -05:00
|
|
|
['self-hosted', 'Linux', 'X64']
|
|
|
|
)
|
|
|
|
|
2022-06-15 19:01:05 -04:00
|
|
|
|
|
|
|
def get_jobs(
|
|
|
|
distribution: str = 'debian',
|
|
|
|
usesSurelog: bool = False
|
|
|
|
):
|
2021-12-15 03:42:37 -05:00
|
|
|
examples = [
|
2022-06-15 19:01:05 -04:00
|
|
|
"pulse_width_led",
|
2022-06-15 20:19:35 -04:00
|
|
|
"hello",
|
2022-06-15 19:01:05 -04:00
|
|
|
]
|
2022-04-04 06:31:49 -04:00
|
|
|
|
|
|
|
# Skip tests that are currently unsupported
|
|
|
|
if not usesSurelog:
|
2022-06-15 19:01:05 -04:00
|
|
|
examples.extend([
|
|
|
|
"litex",
|
|
|
|
"picosoc",
|
|
|
|
"litex_linux",
|
|
|
|
"button_controller",
|
|
|
|
"timer",
|
|
|
|
"hello-k",
|
|
|
|
])
|
|
|
|
|
|
|
|
jobs = []
|
|
|
|
osvers = []
|
|
|
|
|
|
|
|
if distribution == "debian":
|
|
|
|
osvers.extend([
|
|
|
|
("debian", "buster"),
|
|
|
|
("debian", "bullseye"),
|
|
|
|
("debian", "sid")
|
|
|
|
])
|
|
|
|
elif distribution == "ubuntu":
|
|
|
|
osvers.extend([
|
|
|
|
("ubuntu", "focal")
|
|
|
|
])
|
|
|
|
elif distribution == "fedora":
|
|
|
|
osvers.extend([
|
|
|
|
("fedora", "35"),
|
|
|
|
("fedora", "36")
|
|
|
|
])
|
2021-12-14 22:32:15 -05:00
|
|
|
|
2022-06-15 19:01:05 -04:00
|
|
|
if not isFork:
|
|
|
|
examples.extend(["counter"])
|
|
|
|
|
|
|
|
# Skip tests that are currently unsupported
|
|
|
|
if not usesSurelog:
|
|
|
|
examples.extend(["litex_sata"])
|
|
|
|
|
|
|
|
if distribution == "ubuntu":
|
|
|
|
osvers.extend([
|
|
|
|
("ubuntu", "xenial"),
|
|
|
|
("ubuntu", "bionic"),
|
|
|
|
])
|
|
|
|
elif distribution == "centos":
|
|
|
|
osvers.extend([
|
|
|
|
("centos", "7")
|
|
|
|
])
|
|
|
|
|
|
|
|
for osver in osvers:
|
|
|
|
jobs.extend([{
|
|
|
|
'name': "Surelog" if usesSurelog else "Default",
|
|
|
|
'runs-on': runs_on,
|
|
|
|
'fpga-fam': "xc7",
|
|
|
|
'os': osver[0],
|
|
|
|
'os-version': osver[1],
|
|
|
|
'example': example,
|
|
|
|
'surelog': "-parse -DSYNTHESIS" if usesSurelog else ""
|
|
|
|
} for example in examples])
|
|
|
|
|
|
|
|
jobs.extend([{
|
|
|
|
'name': "Surelog" if usesSurelog else "Default",
|
2021-12-14 03:21:51 -05:00
|
|
|
'runs-on': runs_on,
|
2022-06-15 19:01:05 -04:00
|
|
|
'fpga-fam': "eos-s3",
|
2021-10-19 18:05:37 -04:00
|
|
|
'os': osver[0],
|
|
|
|
'os-version': osver[1],
|
2022-06-15 19:01:05 -04:00
|
|
|
'example': "counter",
|
|
|
|
'surelog': "-parse -DSYNTHESIS" if usesSurelog else ""
|
|
|
|
} for osver in osvers])
|
|
|
|
|
|
|
|
return jobs
|
|
|
|
|
2022-06-15 19:38:43 -04:00
|
|
|
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}")
|