-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.04 KB
/
unit_tests.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This workflow will install Python dependencies,
# run tests with a variety of Python versions,
# and upload a new build to TestPyPI.
#
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit tests
on: [push]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: Gr1N/setup-poetry@v9
- name: Install library and dependencies
run: |
poetry run pip install --upgrade pip setuptools
poetry install --with dev
- name: Run pytest
run: |
poetry run pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.os }}
- name: Upload Results to CodeCov
if: success()
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
files: ./tests/coverage-html/index.html,./tests/coverage.xml
flags: unittests
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
testpypi-deploy:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Publish distribution 📦 to Test PyPI
uses: JRubics/[email protected]
continue-on-error: true
with:
ignore_dev_requirements: 'yes'
pypi_token: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_name: 'testpypi'
repository_url: 'https://test.pypi.org/legacy/'