Repository navigation
77 lines (70 loc) · 2.2 KB
/
Copy pathpythonpackage.yml
File metadata and controls
77 lines (70 loc) · 2.2 KB
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
73
74
75
76
77
# 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 and deploy
on:
push:
branches: [ main ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+'
pull_request:
branches: [ main ]
jobs:
test:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: "${{matrix.os}}"
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install MICOM and development dependencies
run: uv sync --locked --group test --group lint
- name: Lint
run: |
uv run ruff check .
uv run ruff format --check micom tests
- name: Test with pytest
run: uv run pytest --cov=micom --cov-report=xml tests
- name: Upload to codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
uses: codecov/codecov-action@v7.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
needs: test
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v7
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Build distributions
run: uv build
- name: Publish distributions
run: uv publish
- uses: actions/upload-artifact@v7
with:
name: python-packages
path: dist/*
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: 'dist/*'
body: |
Please see https://micom-dev.github.io/micom/NEWS.html for the full release notes.
draft: false
prerelease: false