Skip to content

Merge branch 'gtf-manifest' into gtf-buildingmotif (#32) #1320

Merge branch 'gtf-manifest' into gtf-buildingmotif (#32)

Merge branch 'gtf-manifest' into gtf-buildingmotif (#32) #1320

Workflow file for this run

name: continuous integration
on:
push:
pull_request_review:
types: [submitted]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
styling:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- name: install-uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: setup-python
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: install
run: uv sync --all-extras --python 3.11
- name: run isort and black
run: |
uv run isort . --check
uv run black . --check
# The "testing" job verifies the base SDK functionality across
# all supported Python versions.
testing:
if: github.event_name == 'push'
needs: styling
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
steps:
- name: checkout
uses: actions/checkout@v7
- uses: actions/setup-java@v5 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: install-uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: install
run: uv sync --all-extras --python ${{ matrix.python-version }}
- name: lint
run: uv run flake8 buildingmotif
- name: type check
run: uv run mypy --ignore-missing-imports
- name: unit tests
run: uv run --with pytest-xdist pytest -n auto tests/unit --cov=./ --cov-report=xml
- name: build tests
run: uv build
# We only run "integration" tests on the latest Python version.
# These tests detect if changes to ontologies, libraries, models and BuildingMOTIF
# affect correct operation of notebooks and BACnet scans. Library integration testing
# is a separate job
integration:
if: github.event_name == 'push'
needs: styling
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: checkout
uses: actions/checkout@v7
- uses: actions/setup-java@v5 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: install-uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: install
run: uv sync --all-extras --python ${{ matrix.python-version }}
- name: integration tests
run: uv run --with pytest-xdist pytest -n auto tests/integration
- name: bacnet tests
run: |
cd tests/integration/fixtures/bacnet
docker compose build device buildingmotif
docker compose run -d device
docker compose run buildingmotif uv run pytest -m bacnet
docker compose down
# We only run "library" tests on the latest Python version.
# These tests detect if changes to ontologies, libraries, models and BuildingMOTIF
# affect correct operation of templates, shapes, and validation
libraries:
if: github.event.review.state == 'approved' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: checkout
uses: actions/checkout@v7
- uses: actions/setup-java@v5 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: install-uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: install
run: uv sync --all-extras --python ${{ matrix.python-version }}
- name: library tests
run: uv run --with pytest-xdist pytest -n auto tests/library
coverage:
needs: testing
runs-on: ubuntu-latest
steps:
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml