Skip to content

Commit

Permalink
Run tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-scherbakov committed Jan 7, 2024
1 parent d620de7 commit 529c7fd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Unit tests

on: [pull_request, push, workflow_dispatch]

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
# Issue: https://github.com/actions/checkout/issues/211#issuecomment-1368283898
- name: Chown user
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Install dependencies
run: pip install .

- name: Test
shell: bash
run: j test -- --junitxml=tests/coverage/pytest.xml --cov-report= --cov-report=html:tests/coverage/html --cov=yaml_ld | tee tests/coverage/pytest-coverage.txt

# Report only changed files because the result is too large
- name: Pytest Coverage Comment
uses: MishaKav/pytest-coverage-comment@main
id: coverage_comment
with:
pytest-coverage-path: tests/coverage/pytest-coverage.txt
junitxml-path: tests/coverage/pytest.xml
report-only-changed-files: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,5 @@ cython_debug/

.python-version
.flakeheaven_cache
tests/coverage/
-tests/coverage/.gitkeep
Empty file added tests/coverage/.gitkeep
Empty file.

0 comments on commit 529c7fd

Please sign in to comment.