Merge pull request #65 from starsimhub/edits-dec18 #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |