Skip to content

Commit

Permalink
Merge pull request #325 from masayukig/add-coverxml-codecov
Browse files Browse the repository at this point in the history
Add coverxml task and cover job
  • Loading branch information
mtreinish authored Apr 26, 2022
2 parents 7227dc5 + e266b31 commit dab8368
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,36 @@ jobs:
run: python -m pip install -U tox
- name: Run lint
run: tox -epep8
cover:
name: cover
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-lint-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-lint-
${{ runner.os }}-${{ matrix.python-version }}-pip-
${{ runner.os }}-${{ matrix.python-version }}-
- name: Install Deps
run: python -m pip install -U tox
- name: Run coverxml
run: tox -ecoverxml
- name: codecov
uses: codecov/codecov-action@v2
with:
files: ./cover/coverage.xml # optional
flags: unittests # optional
name: stestr # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
docs:
name: docs
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ commands =
coverage combine
coverage html -d cover

[testenv:coverxml]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source stestr
commands =
coverage run stestr/cli.py run {posargs}
coverage combine
coverage xml -o cover/coverage.xml

[testenv:docs]
extras =
sql
Expand Down

0 comments on commit dab8368

Please sign in to comment.