Repository navigation
124 lines (117 loc) · 4.37 KB
/
Copy pathpython.yml
File metadata and controls
124 lines (117 loc) · 4.37 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
name: python
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
concurrency:
group: python-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: Lint and type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Type-check on the oldest supported Python, the target of mypy's configuration.
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml
- name: Install the package and development tools
run: python -m pip install --upgrade pip ".[dev]"
- name: Ruff
run: |
python -m ruff check src tests examples docs
python -m ruff format --check src tests examples docs
- name: Mypy (strict)
run: python -m mypy src
test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
include:
- os: windows-latest
python-version: '3.13'
- os: macos-latest
python-version: '3.13'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install the package and test dependencies
run: python -m pip install --upgrade pip ".[dev]"
- name: Run the tests with the coverage check
# Coverage settings (source, fail-under 85 %) live in pyproject.toml. Tests that
# need OpenFAST or local reference data skip on hosted runners.
run: python -m pytest -q -n auto --cov-report=xml
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always() && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
with:
name: vane-coverage
path: coverage.xml
if-no-files-found: ignore
distribution:
name: Build Python distributions
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.13'
- run: python -m pip install --upgrade pip build
- name: Build reproducible distributions
shell: bash
run: |
export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"
python -m build --outdir dist
- name: Install and inspect the wheel in a clean environment
shell: bash
run: |
python -m venv wheel-test
wheel-test/bin/python -m pip install dist/*.whl
wheel-test/bin/python -c "import vane; print(vane.__version__)"
wheel-test/bin/vane --version
wheel-test/bin/vane --help
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: vane-python-distributions
path: dist/*
if-no-files-found: error
documentation:
name: Sphinx documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.13'
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install the package and the documentation dependencies
run: python -m pip install --upgrade pip -r docs/requirements.txt .
- name: Build documentation with warnings as errors
run: sphinx-build -W --keep-going -b html docs docs/_build/html