-
Notifications
You must be signed in to change notification settings - Fork 90
137 lines (132 loc) · 4.09 KB
/
client.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
on:
push:
paths:
- '.github/workflows/client.yml'
- 'api/python/**'
- 'gendocs/**'
- 'testdocs/**'
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install 'pylint==2.10.2' 'pycodestyle>=2.6.1' isort
- name: Run pylint
run: |
pylint $(find ./api/python/ -name '*.py')
- name: Run pycodestyle
run: |
pycodestyle $(find ./api/python/ -name '*.py')
- name: Run isort
run: |
isort --check --diff ./api/python/
test-gendocs:
runs-on: ubuntu-latest
env:
QUILT_DISABLE_USAGE_METRICS: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# on newer versions it crashes with
# TypeError: <classmethod(<function Package.install at 0x105219f30>)> is not a callable object
python-version: '3.9'
- name: install deps
run: |
python -m pip install --upgrade pip setuptools
python -m pip install api/python nbconvert git+https://github.com/quiltdata/pydoc-markdown.git@quilt
- name: generate docs
run: cd gendocs && python build.py
- name: show invisible changes via cat
run: git diff | cat -A
- name: check there are no changes
run: git diff --exit-code
test-testdocs:
runs-on: ubuntu-latest
env:
QUILT_DISABLE_USAGE_METRICS: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: install poetry
run: python -m pip install poetry
- name: install deps
run: cd testdocs && poetry install
- name: test codeblocks
run: cd testdocs && poetry run pytest --codeblocks ../docs
test-client:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
env:
QUILT_DISABLE_USAGE_METRICS: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -e api/python[tests]
- name: Run Pytest
run: |
pytest --cov=api/python api/python
- uses: codecov/codecov-action@v3
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
with:
flags: api-python
name: ${{ github.job }}
env_vars: OS,PYTHON_VERSION
pypi-release-tag-check:
needs: test-client
runs-on: ubuntu-latest
outputs:
check: ${{ steps.check.outputs.check }}
if: github.ref_type == 'tag'
steps:
- name: check git tag
id: check
run: |
if [[ ${{ github.ref_name }} =~ ^[0-9]+(\.[0-9]+)*([abrc]+[0-9]+)?$ ]]; then
echo ::set-output name=check::true
fi
pypi-release:
needs: pypi-release-tag-check
if: github.ref_type == 'tag' && needs.pypi-release-tag-check.outputs.check == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: api/python
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- name: verify git tag vs. version
env:
CIRCLE_TAG: ${{ github.ref_name }}
run: python setup.py verify
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install build==0.8.0 twine==4.0.0
- name: build
run: python -m build
- name: upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*