-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (45 loc) · 1.35 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
tests:
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-14]
exclude:
- python_version: "3.9"
os: macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python_version }}'
cache: 'pip'
- run: pip install -e .[test]
- run: pytest --durations=10 --cov=sparseconverter --cov-report=xml --cov-config=setup.cfg tests/
- uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
runs-on: ubuntu-latest
needs: [tests]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Make virtualenv
run: python -m venv venv
- name: Install tooling
run: ./venv/bin/pip install build
- name: Build wheel
run: ./venv/bin/python -m build --wheel --sdist
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}