Merge pull request #229 from umarcor/default-runners
ci: use default runners when running CI on a fork
This commit is contained in:
commit
140dbd1e3e
|
@ -1,11 +1,19 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from sys import argv as sys_argv
|
||||||
|
|
||||||
|
isFork = len(sys_argv)>1 and sys_argv[1] != 'SymbiFlow/symbiflow-examples'
|
||||||
|
|
||||||
|
runs_on = (
|
||||||
|
'ubuntu-latest'
|
||||||
|
if isFork else
|
||||||
|
['self-hosted', 'Linux', 'X64']
|
||||||
|
)
|
||||||
|
|
||||||
examples = [
|
examples = [
|
||||||
"counter",
|
|
||||||
"picosoc",
|
"picosoc",
|
||||||
"litex",
|
"litex",
|
||||||
"litex_linux",
|
"litex_linux",
|
||||||
"litex_sata",
|
|
||||||
"button_controller",
|
"button_controller",
|
||||||
"pulse_width_led",
|
"pulse_width_led",
|
||||||
"timer",
|
"timer",
|
||||||
|
@ -26,10 +34,7 @@ examples = [
|
||||||
jobs = []
|
jobs = []
|
||||||
|
|
||||||
osvers = [
|
osvers = [
|
||||||
("ubuntu", "xenial"),
|
|
||||||
("ubuntu", "bionic"),
|
|
||||||
("ubuntu", "focal"),
|
("ubuntu", "focal"),
|
||||||
("centos", "7"),
|
|
||||||
("centos", "8"),
|
("centos", "8"),
|
||||||
("debian", "buster"),
|
("debian", "buster"),
|
||||||
("debian", "bullseye"),
|
("debian", "bullseye"),
|
||||||
|
@ -37,8 +42,20 @@ osvers = [
|
||||||
("fedora", "35")
|
("fedora", "35")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if not isFork:
|
||||||
|
examples = [
|
||||||
|
"counter",
|
||||||
|
"litex_sata",
|
||||||
|
] + examples
|
||||||
|
osvers += [
|
||||||
|
("ubuntu", "xenial"),
|
||||||
|
("ubuntu", "bionic"),
|
||||||
|
("centos", "7"),
|
||||||
|
]
|
||||||
|
|
||||||
for osver in osvers:
|
for osver in osvers:
|
||||||
jobs += [{
|
jobs += [{
|
||||||
|
'runs-on': runs_on,
|
||||||
'fpga-fam': "xc7",
|
'fpga-fam': "xc7",
|
||||||
'os': osver[0],
|
'os': osver[0],
|
||||||
'os-version': osver[1],
|
'os-version': osver[1],
|
||||||
|
@ -46,10 +63,13 @@ for osver in osvers:
|
||||||
} for example in examples]
|
} for example in examples]
|
||||||
|
|
||||||
jobs += [{
|
jobs += [{
|
||||||
|
'runs-on': runs_on,
|
||||||
'fpga-fam': "eos-s3",
|
'fpga-fam': "eos-s3",
|
||||||
'os': osver[0],
|
'os': osver[0],
|
||||||
'os-version': osver[1],
|
'os-version': osver[1],
|
||||||
'example': "counter"
|
'example': "counter"
|
||||||
} for osver in osvers]
|
} for osver in osvers]
|
||||||
|
|
||||||
print('::set-output name=matrix::' + str(jobs))
|
print(f'::set-output name=matrix::{jobs!s}')
|
||||||
|
|
||||||
|
print(str(jobs))
|
||||||
|
|
|
@ -21,16 +21,17 @@ jobs:
|
||||||
|
|
||||||
- name: Generate examples matrix
|
- name: Generate examples matrix
|
||||||
id: generate
|
id: generate
|
||||||
run: ./.github/scripts/generate_job_matrix.py
|
run: ./.github/scripts/generate_job_matrix.py '${{ github.repository }}'
|
||||||
|
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
needs: Matrix
|
needs: Matrix
|
||||||
runs-on: [self-hosted, Linux, X64]
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
|
include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
name: ${{ matrix.fpga-fam }} | ${{ matrix.os }} ${{ matrix.os-version }} | ${{ matrix.example }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
LANG: "en_US.UTF-8"
|
LANG: "en_US.UTF-8"
|
||||||
|
|
Loading…
Reference in New Issue