From e051b9aa13e599b9d169c02f48f6bc61b6df6bb5 Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 14 Dec 2021 09:21:51 +0100 Subject: [PATCH 1/3] ci: use default runners when running CI on a fork Signed-off-by: umarcor --- .github/scripts/generate_job_matrix.py | 14 +++++++++++++- .github/workflows/sphinx-tuttest.yml | 5 +++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/scripts/generate_job_matrix.py b/.github/scripts/generate_job_matrix.py index e3e5985..e6f38bf 100755 --- a/.github/scripts/generate_job_matrix.py +++ b/.github/scripts/generate_job_matrix.py @@ -1,5 +1,13 @@ #!/usr/bin/env python3 +from sys import argv as sys_argv + +runs_on = ( + 'ubuntu-latest' + if len(sys_argv)>1 and sys_argv[1] != 'SymbiFlow/symbiflow-examples' else + ['self-hosted', 'Linux', 'X64'] +) + examples = [ "counter", "picosoc", @@ -39,6 +47,7 @@ osvers = [ for osver in osvers: jobs += [{ + 'runs-on': runs_on, 'fpga-fam': "xc7", 'os': osver[0], 'os-version': osver[1], @@ -46,10 +55,13 @@ for osver in osvers: } for example in examples] jobs += [{ + 'runs-on': runs_on, 'fpga-fam': "eos-s3", 'os': osver[0], 'os-version': osver[1], 'example': "counter" } for osver in osvers] -print('::set-output name=matrix::' + str(jobs)) +print(f'::set-output name=matrix::{jobs!s}') + +print(str(jobs)) diff --git a/.github/workflows/sphinx-tuttest.yml b/.github/workflows/sphinx-tuttest.yml index 8673ddf..23ddfb6 100644 --- a/.github/workflows/sphinx-tuttest.yml +++ b/.github/workflows/sphinx-tuttest.yml @@ -21,16 +21,17 @@ jobs: - name: Generate examples matrix id: generate - run: ./.github/scripts/generate_job_matrix.py + run: ./.github/scripts/generate_job_matrix.py '${{ github.repository }}' Test: needs: Matrix - runs-on: [self-hosted, Linux, X64] strategy: fail-fast: false matrix: include: ${{ fromJson(needs.Matrix.outputs.matrix) }} + runs-on: ${{ matrix.runs-on }} + name: ${{ matrix.fpga-fam }} | ${{ matrix.os }} ${{ matrix.os-version }} | ${{ matrix.example }} env: LANG: "en_US.UTF-8" From 70f7135e90060b0becf4f6c8cdc03e19f9d42765 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 15 Dec 2021 04:32:15 +0100 Subject: [PATCH 2/3] ci: limit os versions on forks Signed-off-by: umarcor --- .github/scripts/generate_job_matrix.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate_job_matrix.py b/.github/scripts/generate_job_matrix.py index e6f38bf..083acd2 100755 --- a/.github/scripts/generate_job_matrix.py +++ b/.github/scripts/generate_job_matrix.py @@ -2,9 +2,11 @@ from sys import argv as sys_argv +isFork = len(sys_argv)>1 and sys_argv[1] != 'SymbiFlow/symbiflow-examples' + runs_on = ( 'ubuntu-latest' - if len(sys_argv)>1 and sys_argv[1] != 'SymbiFlow/symbiflow-examples' else + if isFork else ['self-hosted', 'Linux', 'X64'] ) @@ -34,10 +36,7 @@ examples = [ jobs = [] osvers = [ - ("ubuntu", "xenial"), - ("ubuntu", "bionic"), ("ubuntu", "focal"), - ("centos", "7"), ("centos", "8"), ("debian", "buster"), ("debian", "bullseye"), @@ -45,6 +44,13 @@ osvers = [ ("fedora", "35") ] +if not isFork: + osvers += [ + ("ubuntu", "xenial"), + ("ubuntu", "bionic"), + ("centos", "7"), + ] + for osver in osvers: jobs += [{ 'runs-on': runs_on, From 2fd3922b6facf73177d1fa5dcc8af19383cfa003 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 15 Dec 2021 09:42:37 +0100 Subject: [PATCH 3/3] ci: disable 'counter' and 'litex_sata' on forks Signed-off-by: umarcor --- .github/scripts/generate_job_matrix.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate_job_matrix.py b/.github/scripts/generate_job_matrix.py index 083acd2..6351636 100755 --- a/.github/scripts/generate_job_matrix.py +++ b/.github/scripts/generate_job_matrix.py @@ -11,11 +11,9 @@ runs_on = ( ) examples = [ - "counter", "picosoc", "litex", "litex_linux", - "litex_sata", "button_controller", "pulse_width_led", "timer", @@ -45,6 +43,10 @@ osvers = [ ] if not isFork: + examples = [ + "counter", + "litex_sata", + ] + examples osvers += [ ("ubuntu", "xenial"), ("ubuntu", "bionic"),