From e051b9aa13e599b9d169c02f48f6bc61b6df6bb5 Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 14 Dec 2021 09:21:51 +0100 Subject: [PATCH] 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"