Update exception handling of imported functions #246
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*" | |
paths: | |
- ".github/workflows/ci.yml" | |
- "**.py" | |
- "!kui/__version__.py" | |
- pdm.lock | |
pull_request: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/ci.yml" | |
- "**.py" | |
- "!kui/__version__.py" | |
- pdm.lock | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }} ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pdm-project/setup-pdm@v3 | |
name: Setup Python and PDM | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
version: "2.10.4" | |
cache: true | |
- name: Install dependencies | |
run: pdm sync | |
- name: Static type and format checking | |
run: | | |
pdm run check | |
- name: Run tests | |
run: | | |
pdm run test --cov=./kui --cov-report=xml tests | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
files: ./coverage.xml | |
directory: ./coverage/reports/ | |
flags: unittests | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
path_to_write_report: ./coverage/codecov_report.txt | |
verbose: true | |
- name: Install pydantic v1 | |
run: | | |
pdm add pydantic==1.10.* | |
- name: Run tests | |
run: | | |
pdm run test --cov=./kui --cov-report=xml tests | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
files: ./coverage.xml | |
directory: ./coverage/reports/ | |
flags: unittests | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
path_to_write_report: ./coverage/codecov_report.txt | |
verbose: true | |
publish: | |
needs: tests | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pdm-project/setup-pdm@v3 | |
name: Setup Python and PDM | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
version: "2.10.4" | |
cache: true | |
- name: Publish | |
run: pdm publish --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} |