-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (33 loc) · 1.17 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Validate code
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
pull-requests: write
contents: read
jobs:
validate_commit_py311:
name: Validate commit on Python 3.11
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install Poetry and dependencies
uses: SneaksAndData/github-actions/[email protected]
with:
install_extras: all
- name: Unit test
run: |
set -euxo pipefail
poetry run pytest ./tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
- name: Publish Code Coverage
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./junit/test-results.xml