Skip to content

Update to use openapi-core 0.19.0 #48

Update to use openapi-core 0.19.0

Update to use openapi-core 0.19.0 #48

Workflow file for this run

# Run all tests, linters, code analysis and other QA tasks on
# every push to master and PRs.
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- '*'
# To SSH into the runner to debug a failure, add the following step before
# the failing step
# - uses: lhotari/action-upterm@v1
# with:
# limit-access-to-actor: true
# Prevent multiple jobs running after fast subsequent pushes
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test_311:
name: "Python 3.11 Tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nix-shell
with:
cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Run linters and unit tests
run: |
nix-shell --run "make lint all=true"
nix-shell --run "make types"
nix-shell --run "make unit"
- name: Run tests for the singlefile example
run: |
cd examples/singlefile
nix-shell --run "python -m unittest app.py"
- name: Run tests for the todoapp example
run: |
cd examples/todoapp
nix-shell --run "python -m unittest tests.py"
- name: Run tests for the splitfile example
run: |
cd examples/splitfile
nix-shell --run "python -m unittest tests.py"
- name: Save coverage report
uses: actions/upload-artifact@v3
with:
name: htmlcov
path: htmlcov
- name: Upload test durations to BlueRacer.io
if: |
github.event_name == 'pull_request' ||
(github.event_name == 'push' && !contains(github.ref, 'refs/tags/'))
env:
BLUERACER_TOKEN: ${{ secrets.BLUERACER_TOKEN }}
run: bash <(curl -s https://app.blueracer.io/upload)
test_38:
name: "Python 3.8 Tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nix-shell
with:
cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: unit tests
run: |
nix-shell --run "PYTHON=python3.8 make unit"
- name: Run tests for the singlefile example
run: |
cd examples/singlefile
nix-shell --run "python3.8 -m unittest app.py"
- name: Run tests for the todoapp example
run: |
cd examples/todoapp
nix-shell --run "python3.8 -m unittest tests.py"
- name: Run tests for the splitfile example
run: |
cd examples/splitfile
nix-shell --run "python3.8 -m unittest tests.py"
- name: Save coverage report
uses: actions/upload-artifact@v3
with:
name: htmlcov
path: htmlcov
release:
name: "Release to PyPI"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [test_311, test_38]
runs-on: ubuntu-22.04
# To test publishing to testpypi:
# * change version in pyproject.toml to 0.16.1-alpha.1 or similar
# * uncomment POETRY_REPOSITORIES_TESTPYPI_URL and POETRY_PYPI_TOKEN_TESTPYPI
# * append `-r testpypi` to poetry publish command
# * `git ci && git tag 0.16.1-alpha.1 && git push --tags`
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
# POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.POETRY_PYPI_TOKEN_TESTPYPI }}
# POETRY_REPOSITORIES_TESTPYPI_URL: https://test.pypi.org/legacy/
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nix-shell
with:
cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: verify git tag matches pyproject.toml version
run: |
echo "$GITHUB_REF_NAME"
POETRY_VERSION=$(nix-shell --run "poetry version --short")
echo $POETRY_VERSION
nix-shell --run "echo `poetry version --short`"
[[ "$GITHUB_REF_NAME" == "$POETRY_VERSION" ]] && exit 0 || exit 1
- run: nix-shell --run "poetry publish --build"