Skip to content

Commit

Permalink
Merge branch 'develop' into gtf-validation-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro authored Oct 30, 2024
2 parents 5510cbd + b1275d5 commit e1e48b1
Show file tree
Hide file tree
Showing 174 changed files with 409,753 additions and 50,096 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: continuous deployment

on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
- main
release:
types:
- published

jobs:

# deploy docs for develop and main branches
# deploy docs if not release
deploy-docs:
if: github.event_name != 'release'
runs-on: ubuntu-latest
steps:
# setup, checkout pull_request.head.ref for repo-vis
Expand Down Expand Up @@ -56,10 +55,9 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html

# deploy distribution if a new release and tag are created
# deploy distribution if release
deploy-dist:
needs: deploy-docs
if: startsWith(github.ref, 'refs/tags')
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
# setup
Expand Down
82 changes: 79 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: continuous integration

on:
push
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
Expand All @@ -27,7 +34,10 @@ jobs:
poetry run isort . --check
poetry 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:
Expand All @@ -36,6 +46,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v4 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: setup-python
uses: actions/setup-python@v5
with:
Expand All @@ -54,6 +68,39 @@ jobs:
run: poetry run mypy --ignore-missing-imports
- name: unit tests
run: poetry run pytest tests/unit --cov=./ --cov-report=xml
- name: build tests
run: poetry 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@v4
- uses: actions/setup-java@v4 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install-poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: poetry install
run: poetry install --all-extras
- name: integration tests
run: poetry run pytest tests/integration
- name: bacnet tests
Expand All @@ -63,8 +110,37 @@ jobs:
docker compose run -d device
docker compose run buildingmotif poetry run pytest -m bacnet
docker compose down
- name: build tests
run: poetry build
# 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@v4
- uses: actions/setup-java@v4 # for topquadrant shacl support
with:
distribution: 'temurin'
java-version: '21'
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install-poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: poetry install
run: poetry install --all-extras
- name: library tests
run: poetry run pytest tests/library

coverage:
needs: testing
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ repos:
entry: poetry run flake8 buildingmotif
# can't poetry run becuase not present in repository https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
args: ["--install-types", "--non-interactive", "--ignore-missing-imports", "--follow-imports=skip", "--disable-error-code=import-untyped"]
additional_dependencies: [sqlalchemy2-stubs <= 0.0.2a20, SQLAlchemy <= 1.4]
additional_dependencies: [sqlalchemy2-stubs <= 0.0.2a38, SQLAlchemy < 1.5]
exclude: docs/conf.py
2 changes: 1 addition & 1 deletion buildingmotif-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.10.0
FROM node:18.19.0

WORKDIR /buildingmotif-app
COPY . .
Expand Down
8 changes: 7 additions & 1 deletion buildingmotif-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.css"
],
"scripts": []
"scripts": [
"./node_modules/blockly/blockly_compressed.js",
"./node_modules/blockly/blocks_compressed.js",
"./node_modules/blockly/javascript_compressed.js",
"./node_modules/blockly/msg/en.js",
"./src/app/pointlabel-parser/blocks.js"
]
},
"configurations": {
"production": {
Expand Down
Loading

0 comments on commit e1e48b1

Please sign in to comment.