Split the workflows into catalog.yml, client.yml, and lambdas.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |