-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (66 loc) · 2.25 KB
/
test.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
72
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test Python package
on:
push:
# branches: [ $default-branch ]
branches-ignore:
- 'main'
- 'develop'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
# runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
# os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install .[dev]
python -m pip install .[test]
- name: Test with tox
run: |
python -m tox -e py
# echo "Passing :P"
- name: Test with nose2
run: |
python create_report_dirs.py
nose2 --config tests/unittest.cfg
coverage xml
coverage html
- name: Install deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--debug
python -m build .
- name: Test built package
run: |
twine check dist/*.tar.gz
- name: Archive build package artifact
uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
with:
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
name: dist_py.${{ matrix.python-version }}_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
path: dist/*.tar.gz
retention-days: 14