new pyproject and setup #829
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: ci | |
on: [push, pull_request] | |
env: | |
X_PYTHON_VERSION: "3.12" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.10", "3.12"] | |
env: | |
COUCHDB_ADMIN_PASSWORD: "yo0Quai3" | |
AAS_SPECS_RELEASE_TAG: "V3.0.7" | |
services: | |
couchdb: | |
image: couchdb:3 | |
ports: | |
- 5984:5984 | |
env: | |
COUCHDB_USER: "admin" | |
COUCHDB_PASSWORD: ${{ env.COUCHDB_ADMIN_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Collect schema files from aas-specs | |
run: | | |
mkdir -p ./test/adapter/schema | |
curl -sSL -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json | |
curl -sSL -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev,test] | |
- name: Setup test config and CouchDB database server | |
run: | | |
python test/_helper/setup_testdb.py -u "admin" -p "$COUCHDB_ADMIN_PASSWORD" | |
- name: Test with coverage + unittest | |
run: | | |
coverage run --source=basyx -m unittest | |
- name: Report test coverage | |
if: ${{ always() }} | |
run: | | |
coverage report -m | |
static-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.X_PYTHON_VERSION }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Check typing with MyPy | |
run: | | |
mypy --install-types --non-interactive basyx test | |
- name: Check code style with PyCodestyle | |
run: | | |
pycodestyle --count --max-line-length 120 basyx test | |
readme-codeblocks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.X_PYTHON_VERSION }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Check typing with MyPy | |
run: | | |
mypy <(codeblocks python README.md) | |
- name: Check code style with PyCodestyle | |
run: | | |
codeblocks --wrap python README.md | pycodestyle --count --max-line-length 120 - | |
- name: Run readme codeblocks with Python | |
run: | | |
codeblocks python README.md | python | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.X_PYTHON_VERSION }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[docs] | |
- name: Check documentation for errors | |
run: | | |
SPHINXOPTS="-a -E -n -W --keep-going" make -C docs html | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.X_PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Create source and wheel dist | |
run: | | |
python -m build |