diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..7155e3b --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,14 @@ +name: Lint + +on: [push] + +jobs: + lint: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable + with: + options: "--check --verbose" + src: "./src" + use_pyproject: true \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..e0f05c4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,31 @@ +name: Continuous Integration + +on: [pull_request] + +jobs: + install: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + - name: Install blender + run: | + sudo apt-get update + sudo apt-get install blender python3-pip python3-venv -y + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + - name: Generate composable models + run: | + textx generate models/examples/*.floorplan --target json-ld --output-path . + - name: Generate 3D mesh and occupancy grid + working-directory: ./src + run: | + blender --background --python-use-system-env --python exsce_floorplan/exsce_floorplan.py -- ../models/examples/brsu_building_c_with_doorways.floorplan + lint: + uses: ./.github/workflows/black.yaml \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d6b8d99..e2f2d7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ classifiers = [ ] [project.optional-dependencies] -dev =["wheel", "twine"] +dev =["wheel", "twine", "black>=24.4.2"] test =[ "flake8", "tox", @@ -69,3 +69,6 @@ where = ["src"] # list of folders that contain the packages (["."] by default) [tool.setuptools.package-data] "*" = ["*.tx"] + +[tool.black] +required-version = "24.4.2"