-
Notifications
You must be signed in to change notification settings - Fork 8
164 lines (140 loc) · 4.43 KB
/
main.push.workflow.yaml
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
---
name: "Main branch verification"
on:
push:
branches:
- main
jobs:
Tests:
name: "Tests | ${{ matrix.os }} | Python ${{ matrix.python-version }}"
env:
USING_COVERAGE: '3.11'
USING_DOCS: '3.11'
USING_DIST: '3.11'
strategy:
fail-fast: false
matrix:
os: ["Ubuntu", "Windows"]
python-version: ["3.11", "3.10"]
runs-on: "${{ matrix.os }}-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/[email protected]"
with:
python-version: "${{ matrix.python-version }}"
- uses: "abatilo/[email protected]"
- name: "Install dependencies"
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel coverage[toml] tox tox-gh-actions
poetry install
# - name: "Configure poetry"
# run: poetry config virtualenvs.in-project true
#
# - name: "Set up cache"
# uses: actions/cache@v2
# id: cache
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
#
# - name: "Ensure cache is healthy"
# if: steps.cache.outputs.cache-hit == 'true'
# run: timeout 10s poetry run pip --version || rm -rf .venv
- name: "Run tox targets for ${{ matrix.python-version }}"
run: tox
# - name: "Get coverage"
# if: "contains(env.USING_COVERAGE, matrix.python-version)"
# run: |
# set -xe
# tox -e coverage-report
# - name: "Upload coverage to Codecov"
# if: "contains(env.USING_COVERAGE, matrix.python-version)"
# uses: "codecov/codecov-action@v1"
# with:
# fail_ci_if_error: true
- name: "Upload docs artifacts"
if: "contains(env.USING_DOCS, matrix.python-version)"
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build/html
#
# - name: "Upload coverage artifacts"
# if: "contains(env.USING_DOCS, matrix.python-version)"
# uses: actions/upload-artifact@v3
# with:
# name: coverage
# path: .coverage-reports
#
# - name: "Publish package to TestPyPI"
# if: "contains(env.TESTPYPI_PUBLISH, matrix.python-version)"
# uses: pypa/[email protected]
# with:
# skip_existing: true
# user: __token__
# password: ${{ secrets.TESTPYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
Build:
needs: Tests
strategy:
fail-fast: false
matrix:
os: ["Ubuntu"]
python-version: ["3.9"]
runs-on: "${{ matrix.os }}-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/[email protected]"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install poetry"
uses: "abatilo/[email protected]"
#
# - name: "Configure poetry"
# run: poetry config virtualenvs.in-project true
#
# - name: "Set up cache"
# uses: actions/cache@v2
# id: cache
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
#
# - name: "Ensure cache is healthy"
# if: steps.cache.outputs.cache-hit == 'true'
# run: timeout 10s poetry run pip --version || rm -rf .venv
- name: "Build package"
id: build
run: |
poetry build
- name: "Upload dist artifacts"
uses: actions/upload-artifact@v3
with:
name: package-dist-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
path: dist/
- name: "Run help"
run: "poetry run yacfg --help"
Publish:
needs: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: docs
path: pages
#
# - uses: actions/download-artifact@master
# with:
# name: coverage
# path: pages/coverage
# Push the docs' HTML to github-pages
- name: "GitHub Pages action"
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: pages/