GitHub Actions CI flow.

This commit is contained in:
mrg 2021-02-05 17:20:08 -08:00
parent 5a0c75d573
commit b83d93cc9a
5 changed files with 61 additions and 60 deletions

47
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: ci
on: [push]
jobs:
setup:
runs-on: self-hosted
steps:
- name: Check out repository
uses: actions/checkout@v1
- name: Hello
run: echo "Hello, world!"
scn4me_subm:
# Run this first since it is faster
needs: setup
runs-on: self-hosted
steps:
- name: SCMOS test
run: |
. /home/github-runner/setup-paths.sh
export OPENRAM_HOME="`pwd`/compiler"
export OPENRAM_TECH="`pwd`/technology:/software/PDKs/skywater-tech"
python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 32 -t scn4m_subm
freepdk45:
# Run this second and only if the first passes
needs: scn4me_subm
runs-on: self-hosted
steps:
- name: FreePDK45 test
run: |
. /home/github-runner/setup-paths.sh
export OPENRAM_HOME="`pwd`/compiler"
export OPENRAM_TECH="`pwd`/technology:/software/PDKs/skywater-tech"
python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 32 -t freepdk45
coverage:
needs: [scn4me_subm, freepdk45]
runs-on: self-hosted
steps:
- name: Coverage stats
run: |
python3-coverage combine
python3-coverage report
python3-coverage html -d coverage_html
- name: Archive coverage
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage_html/

View File

@ -1,48 +0,0 @@
before_script:
- . /home/gitlab-runner/setup-paths.sh
- export OPENRAM_HOME="`pwd`/compiler"
- export OPENRAM_TECH="`pwd`/technology:/home/PDKs/skywater-tech"
stages:
- test
- coverage
freepdk45:
stage: test
script:
- coverage run -p $OPENRAM_HOME/tests/regress.py -j 6 -t freepdk45
artifacts:
paths:
- .coverage.*
expire_in: 1 week
scn4m_subm:
stage: test
script:
- coverage run -p $OPENRAM_HOME/tests/regress.py -j 6 -t scn4m_subm
artifacts:
paths:
- .coverage.*
expire_in: 1 week
# s8:
# stage: test
# script:
# - coverage run -p $OPENRAM_HOME/tests/regress.py -t s8
# artifacts:
# paths:
# - .coverage.*
# expire_in: 1 week
coverage:
stage: coverage
script:
- coverage combine
- coverage report
- coverage html -d coverage_html
artifacts:
paths:
- coverage_html
expire_in: 1 week
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'

View File

@ -19,6 +19,7 @@ import re
import copy
import importlib
import getpass
import subprocess
VERSION = "1.1.9"
@ -161,6 +162,17 @@ def check_versions():
# or, this could be done in each module (e.g. verify, characterizer, etc.)
global OPTS
def cmd_exists(cmd):
return subprocess.call("type " + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
if cmd_exists("coverage"):
OPTS.coverage_exe = "coverage run -p "
elif cmd_exists("python3-coverage"):
OPTS.coverage_exe = "python3-coverage run -p "
else:
OPTS.coverage_exe = ""
debug.warning("Failed to find coverage installation. This can be installed with pip3 install coverage")
try:
import coverage
OPTS.coverage = 1

View File

@ -46,12 +46,7 @@ class openram_back_end_test(openram_test):
if OPTS.spice_name:
options += " -s {}".format(OPTS.spice_name)
# Always perform code coverage
if OPTS.coverage == 0:
debug.warning("Failed to find coverage installation. This can be installed with pip3 install coverage")
exe_name = "{0}/openram.py ".format(OPENRAM_HOME)
else:
exe_name = "coverage run -p {0}/openram.py ".format(OPENRAM_HOME)
exe_name = "{0}{1}/openram.py ".format(OPTS.coverage_exe, OPENRAM_HOME)
config_name = "{0}/tests/configs/config_back_end.py".format(OPENRAM_HOME)
cmd = "{0} -o {1} -p {2} {3} {4} 2>&1 > {5}/output.log".format(exe_name,
out_file,

View File

@ -46,12 +46,7 @@ class openram_front_end_test(openram_test):
if OPTS.spice_name:
options += " -s {}".format(OPTS.spice_name)
# Always perform code coverage
if OPTS.coverage == 0:
debug.warning("Failed to find coverage installation. This can be installed with pip3 install coverage")
exe_name = "{0}/openram.py ".format(OPENRAM_HOME)
else:
exe_name = "coverage run -p {0}/openram.py ".format(OPENRAM_HOME)
exe_name = "{0}{1}/openram.py ".format(OPTS.coverage_exe, OPENRAM_HOME)
config_name = "{0}/tests/configs/config_front_end.py".format(OPENRAM_HOME)
cmd = "{0} -n -o {1} -p {2} {3} {4} 2>&1 > {5}/output.log".format(exe_name,
out_file,