Allow running actions manually #84
Workflow file for this run
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: tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests: | |
name: Python ${{ matrix.python }} | |
runs-on: "ubuntu-latest" | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install .[lxml,cli,test,soap] | |
- name: Test | |
run: | | |
pytest --cov=./xsdata_attrs --cov-report=xml --cov-branch --doctest-glob="docs/*.rst" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
sample-tests: | |
name: Python ${{ matrix.python }} - ${{ matrix.collection.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ "3.10" ] | |
collection: | |
- { name: "Amadeus", id: "amadeus" } | |
- { name: "Autosar", id: "autosar" } | |
- { name: "BPMN", id: "bpmn" } | |
- { name: "Common Types", id: "common-types" } | |
- { name: "Crossref Metadata", id: "crossref" } | |
- { name: "DateX II", id: "datexii" } | |
- { name: "EWP", id: "ewp" } | |
- { name: "Generali", id: "generali", skip_mypy: true } | |
- { name: "NeTEx", id: "netex" } | |
- { name: "NPO API", id: "npo" } | |
- { name: "ReqIF", id: "reqif" } | |
- { name: "Sabre", id: "sabre" } | |
- { name: "Sdmx-ml", id: "sdmx-ml", skip_mypy: true } | |
- { name: "SpaceX", id: "spacex" } | |
- { name: "TPDB", id: "tpdb" } | |
- { name: "Travelport", id: "travelport" } | |
- { name: "UBL", id: "ubl" } | |
- { name: "Voko", id: "voko" } | |
- { name: "XCBL", id: "xcbl" } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: tefra/xsdata-samples | |
ref: main | |
submodules: true | |
path: xsdata-samples | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip invoke mypy types-attrs types-dataclasses typed_dataclass dataclasses-jsonschema | |
pip install .[cli,test] | |
- name: Generate Code | |
working-directory: ./xsdata-samples | |
run: invoke ${{ matrix.collection.id }}.build --output-format=attrs | |
- name: Run Tests | |
working-directory: ./xsdata-samples | |
run: invoke ${{ matrix.collection.id }}.test --output-format=attrs | |
- name: Run mypy | |
if: matrix.collection.skip_mypy != true | |
working-directory: ./xsdata-samples | |
run: invoke ${{ matrix.collection.id }}.mypy | |
pre-commit: | |
name: Pre-commit Hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: pre-commit/[email protected] | |
check-package: | |
name: Build & Inspect Package. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hynek/build-and-inspect-python-package@v2 |