Skip to content

Commit

Permalink
ci: add GHA workflow 'coverage'
Browse files Browse the repository at this point in the history
  • Loading branch information
1138-4EB committed Dec 1, 2019
1 parent 157fae6 commit 64a40cf
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

docker run --rm -t \
-v $(pwd):/src \
-w /src \
-e PYTHONPATH=/src \
"$IMAGE" \
"$@"
37 changes: 37 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'coverage'

on:
push:
schedule:
- cron: '0 0 * * 5'

jobs:

coverage:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: docker.pkg.github.com
IMAGE: docker.pkg.github.com/vunit/vunit/dev:llvm
steps:
- uses: actions/checkout@v1
- run: git submodule update --init --recursive
- uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Docker login
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "$GITHUB_TOKEN" | docker login -u vunit-gha --password-stdin "$DOCKER_REGISTRY"
docker pull $IMAGE
docker logout "$DOCKER_REGISTRY"
- name: Run coverage
run: |
./.github/run.sh tox -e coverage
./.github/run.sh coverage html --directory=htmlcov
- name: Report coverage
run: ./.github/run.sh coverage report -m --skip-covered
- uses: actions/upload-artifact@master
with:
name: VUnit_coverage
path: htmlcov
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38}-fmt, py{35,36,37,38}-{unit}, py{35,36,37,38}-{lint,docs}, py{35,36,37,38}-{acceptance,vcomponents}-{activehdl,ghdl,modelsim,rivierapro}
envlist = py{36,37,38}-fmt, py{35,36,37,38}-{unit}, py{35,36,37,38}-{lint,docs}, py{35,36,37,38}-{acceptance,vcomponents}-{activehdl,ghdl,modelsim,rivierapro}, py{36,37,38}-coverage
skip_missing_interpreters = True

[testenv]
Expand All @@ -11,6 +11,9 @@ deps=
pytest
lint: pycodestyle
lint: pylint
coverage: coverage
coverage: pycodestyle
coverage: pylint
docs: docutils
docs: sphinx
docs: sphinx-argparse
Expand All @@ -29,3 +32,4 @@ commands=
docs: {envpython} tools/build_docs.py {envtmpdir}/docsbuild
acceptance: {envpython} -m pytest -v tests/acceptance
vcomponents: {envpython} vunit/vhdl/verification_components/run.py --clean
coverage: {envpython} -m coverage run --branch --source vunit/ -m unittest discover tests/

0 comments on commit 64a40cf

Please sign in to comment.