Skip to content

Commit

Permalink
Merge pull request #102 from siliconcompiler/gh-runner
Browse files Browse the repository at this point in the history
update github runner setup
  • Loading branch information
gadfort authored Oct 14, 2024
2 parents bef61b7 + ce65a72 commit 00a3ea7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
uses: actions/checkout@v4
- name: Lint with Flake8
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install --upgrade pip
pip install .[test]
flake8 --statistics .
Expand All @@ -30,6 +33,9 @@ jobs:
uses: actions/checkout@v4
- name: Lint with tclint
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install --upgrade pip
pip install .[test]
tclfmt --check .
Expand All @@ -43,6 +49,14 @@ jobs:
uses: actions/checkout@v4
- name: Run tests
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install --upgrade pip
pip install -e .[test]
pytest
# change running directory
mkdir testrun
cd testrun
pytest $GITHUB_WORKSPACE
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
import os


@pytest.fixture
def rootdir():
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
21 changes: 13 additions & 8 deletions tests/test_lambda.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import os
from siliconcompiler import Chip
import lambdalib

Expand All @@ -16,15 +17,16 @@
(gf180mcu, 'lambdapdk/gf180/libs/{lib_name}/lambda/auxlib'),
(sg13g2_stdcell, 'lambdapdk/ihp130/libs/{lib_name}/lambda/auxlib')
])
def test_la_auxlib(module, path):
def test_la_auxlib(module, path, rootdir):
libs = module.setup()
if not isinstance(libs, list):
libs = [libs]
for lib in libs:
lib_name = lib.design
if "lambdalib" in lib_name:
continue
assert lambdalib.check(path.format(lib_name=lib_name), 'auxlib')
assert lambdalib.check(
os.path.join(rootdir, path.format(lib_name=lib_name)), 'auxlib')


@pytest.mark.parametrize('module,path', [
Expand All @@ -34,15 +36,16 @@ def test_la_auxlib(module, path):
(gf180mcu, 'lambdapdk/gf180/libs/{lib_name}/lambda/stdlib'),
(sg13g2_stdcell, 'lambdapdk/ihp130/libs/{lib_name}/lambda/stdlib')
])
def test_la_stdlib(module, path):
def test_la_stdlib(module, path, rootdir):
libs = module.setup()
if not isinstance(libs, list):
libs = [libs]
for lib in libs:
lib_name = lib.design
if "lambdalib" in lib_name:
continue
assert lambdalib.check(path.format(lib_name=lib_name), 'stdlib')
assert lambdalib.check(
os.path.join(rootdir, path.format(lib_name=lib_name)), 'stdlib')


@pytest.mark.parametrize('path', [
Expand All @@ -52,17 +55,19 @@ def test_la_stdlib(module, path):
'lambdapdk/gf180/libs/gf180mcu_fd_ip_sram/lambda',
'lambdapdk/ihp130/libs/sg13g2_sram/lambda',
])
def test_la_ramlib(path):
assert lambdalib.check(path, 'ramlib')
def test_la_ramlib(path, rootdir):
assert lambdalib.check(
os.path.join(rootdir, path), 'ramlib')


@pytest.mark.parametrize('path', [
'lambdapdk/sky130/libs/sky130io/lambda',
'lambdapdk/gf180/libs/gf180mcu_fd_io/lambda',
'lambdapdk/asap7/libs/fakeio7/lambda',
])
def test_la_iolib(path):
assert lambdalib.check(path, 'iolib')
def test_la_iolib(path, rootdir):
assert lambdalib.check(
os.path.join(rootdir, path), 'iolib')


@pytest.mark.parametrize('module', [
Expand Down

0 comments on commit 00a3ea7

Please sign in to comment.