-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (89 loc) · 2.77 KB
/
python.yaml
File metadata and controls
90 lines (89 loc) · 2.77 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
name: ci-cd-pipeline
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-24.04
container: python:3.14
steps:
- uses: actions/checkout@v2
- id: install-dependencies
name: Install dependencies
run: |
pip install poetry
poetry install --extras "examples"
- name: Formatting
if: always()
run: |
poetry run black --check .
- name: Sorted Imports
if: always()
run: |
poetry run isort --check-only .
- name: Type Checks
if: always()
continue-on-error: true
run: poetry run mypy .
- name: Linting
if: always()
run: |
poetry run pylint parameterspace/ tests/
- name: DocStyle Linting
continue-on-error: true
if: always()
run: poetry run pydocstyle
- name: Run tests
if: always()
run: poetry run pytest
- name: Build docs
if: always()
run: poetry run mkdocs build
deploy:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
container: python:3.14
steps:
- uses: actions/checkout@v2
- name: Build
run: |
pip install poetry
- name: Release
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
docs:
needs: test
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.head_commit.message, '[update-docs]') }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all branches, incl. gh-pages
- uses: actions/setup-python@v2
with:
python-version: 3.14
- name: Install dependencies
run: |
pip install poetry
poetry install --extras "examples"
- name: Setup git author and version tag
run: |
git config --global user.name docs deploy
git config --global user.email docs@github-action.local
- name: Get GIT_TAG_NAME
uses: olegtarasov/get-tag@v2.1
id: tagName
- name: "Get previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Update docs for latest version
if: ${{ contains(github.event.head_commit.message, '[update-docs]') && startsWith(github.ref, 'refs/tags/v') == false}}
run: |
poetry run mike deploy --push ${{ steps.previoustag.outputs.tag }}
- name: Publish docs for new version
if: startsWith(github.ref, 'refs/tags/v')
run: |
poetry run mike deploy --push --update-aliases ${{ env.GIT_TAG_NAME }} latest
poetry run mike set-default --push latest