-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) Added GitHub workflow to run tests and calculate coverage
- Loading branch information
abel
committed
Sep 19, 2023
1 parent
05f3bdf
commit a30481c
Showing
4 changed files
with
144 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: run-tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master, dev] | ||
|
||
jobs: | ||
run-tests: | ||
strategy: | ||
matrix: | ||
python: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-18.04, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install poetry | ||
run: python -m pip install poetry | ||
- name: Cache the virtualenv | ||
id: cache-venv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./.venv | ||
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: python -m poetry install | ||
|
||
- name: Run tests and Generate coverage | ||
run: | | ||
poetry run pytest --cov --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
env_vars: OS,PYTHON | ||
verbose: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters