-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (144 loc) · 5.37 KB
/
dev.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# SPDX-FileCopyrightText: 2022 Gabriele Pongelli
#
# SPDX-License-Identifier: MIT
# This is a basic workflow to help you get started with Actions
name: dev workflow
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, main ]
tags:
- '*.*.*'
pull_request:
branches: [ master, main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
poetry-version: [ "1.3" ]
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
os: [ubuntu-latest, windows-latest, macos-latest] # dependency issues on macos-latest and windows-latest
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# https://github.com/actions/setup-python
- uses: actions/setup-python@v4.5.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
poetry install --with devel --sync
# pip install poetry tox tox-gh-actions
- name: build documentation
run: poetry run tox --skip-pkg-install -e docs
- name: linter checks with tox
run:
poetry run tox --skip-pkg-install -e lint
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
- name: test with tox - Windows
if: runner.os == 'Windows'
run:
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-win
- name: test with tox - Linux
if: runner.os == 'Linux'
run:
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-lin
- name: test with tox - MacOS
if: runner.os == 'macOS'
run:
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-mac
- name: list files
run: ls -l .
# https://github.com/codecov/codecov-action
# Easily upload coverage reports to Codecov from GitHub Actions
- uses: codecov/codecov-action@v3
if: runner.os == 'macOS'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./xml_coverage_py${{ matrix.python-version }}-mac.xml
# This workflow contains a single job called "release"
release:
needs: [ test ]
name: Create Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ "3.11" ]
poetry-version: [ "1.3" ]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# https://github.com/BinPar/read-conventional-commit-changelog
- name: Get Changelog Entry
id: changelog
uses: BinPar/read-conventional-commit-changelog@v2.0.2
# https://github.com/actions/setup-python
- uses: actions/setup-python@v4.5.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
poetry install --with devel --sync
# Build and publish documentation
- name: Setup Pages
uses: actions/configure-pages@v2
- name: build documentation
run: poetry run tox --skip-pkg-install -e docs
- name: Upload doc artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs/build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
- name: Build wheels and source tarball
run: >-
poetry build
- name: show temporary files
run: >-
ls -l
# https://github.com/softprops/action-gh-release
- name: create github release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.make_gh_release_token }}
body: ${{ steps.changelog.outputs.version-changelog }}
files: dist/*.whl
draft: false
prerelease: false
# https://github.com/pypa/gh-action-pypi-publish
- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.pypi_username }}
password: ${{ secrets.pypi_password }}
skip_existing: true