-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 1.61 KB
/
tests.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
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
name: STIsim CI tests
on:
push:
branches:
- main
tags: v*
pull_request:
jobs:
test:
timeout-minutes: 8
strategy:
fail-fast: false
max-parallel: 8
matrix:
os: ['ubuntu-latest']
python-version: ['3.11']
runs-on: ${{ matrix.os }}
name: Install and test
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install STIsim
run: pip install -e .
- name: Install tests
working-directory: ./tests
run: pip install -r requirements.txt
- name: Run tests
working-directory: ./tests
run: pytest test_*.py -n auto --durations=0 --junitxml=test-results.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: './tests/test-results.xml'
publish:
if: startsWith(github.ref, 'refs/tags/')
name: Publish on PyPI
runs-on: ubuntu-latest
needs: test
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: '3.11'
architecture: x64
- name: Install dependencies
run: |
pip install setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1