-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.21 KB
/
build-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
name: Unit tests
on:
push:
branches:
- master
tags:
- v*
pull_request:
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install deps
run: |
pip install -e .
pip install -e .[dev]
- name: run tests
run: |
mkdir junit || true
nosetests --with-xunit --with-coverage --cover-package=pytest_opentmi --cover-html --cover-html-dir=htmlcov --cover-xml-file=coverage.xml --xunit-file=junit/results.xml
# missing tests, sorry
#- name: coveralls
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: coveralls
- name: pylint
run: |
pylint pytest_opentmi
- name: run example
working-directory: example
run: |
pytest --opentmi localhost:3000 --opentmi_token 123 --metadata foo bar --metadata DUT_SERIAL_NUMBER 123 --metadata DUT_MODEL S5 --metadata DUT_VENDOR samsang example.py
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ runner.os }}-${{ matrix.python-version }}
path: |
htmlcov/*
junit/*
- name: install rel deps
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
run: |
pip install wheel twine
python setup.py sdist
python setup.py bdist_wheel
- name: upload to pypi
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
env:
TWINE_USERNAME: "${{secrets.TWINE_USERNAME}}"
TWINE_PASSWORD: "${{secrets.TWINE_PASSWORD}}"
run: |
export PATH=$HOME/.local/bin:$PATH;
twine upload dist/*