Skip to content

Commit

Permalink
Merge branch 'develop' into pypi-release-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Dec 27, 2023
2 parents 2af7c48 + 459ab39 commit be1e6ef
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 525 deletions.
44 changes: 18 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11"]
test_env: [python, docs, mypy]
mbl_branch: [maint_9.1.x]
mbl_tag: [v9.1.1]
exclude:
# only test mypy on linux for all versions of python
- os: windows-latest
Expand All @@ -28,10 +28,11 @@ jobs:
- os: windows-latest
test_env: docs
runs-on: ${{ matrix.os }}
permissions: write-all
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display system info
Expand Down Expand Up @@ -59,52 +60,43 @@ jobs:
mv modelicafmt '/c/Program Files/'
fi
- name: Install MBL
env:
MATRIX_OS: ${{ matrix.os }}
MBL_BRANCH: ${{ matrix.mbl_branch }}
run: |
if [[ "${MATRIX_OS}" == 'ubuntu-latest' ]]; then
if [[ '${{ matrix.os }}' == 'ubuntu-latest' ]]; then
MODELICAPATH='/home/runner/work/modelica-buildings'
else
echo $GITHUB_WORKSPACE
MODELICAPATH='/c/Program Files/modelica-buildings'
fi
git clone --single-branch --branch ${MBL_BRANCH} https://github.com/lbl-srg/modelica-buildings.git "${MODELICAPATH}"
git clone --single-branch --branch ${{ matrix.mbl_tag }} https://github.com/lbl-srg/modelica-buildings.git "${MODELICAPATH}"
cd "${MODELICAPATH}"
echo "Git branch is $(git branch)"
# export MODELICAPATH for subsequent steps
echo "MODELICAPATH=${MODELICAPATH}" >> $GITHUB_ENV
- name: Run pytest (simulation on linux only)
- name: Run pytest (including simulations)
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
if [ '${{ matrix.test_env }}' == 'python' ]; then
if [ '${{ matrix.os }}' == 'windows-latest' ]; then
poetry run pytest --doctest-modules -v -m 'not simulation and not compilation and not dymola' ./tests
else
poetry run pytest --doctest-modules -v -m 'not dymola' --cov-report term-missing --cov . ./tests
fi
fi
if: matrix.test_env == 'python' && matrix.os == 'ubuntu-latest'
run: poetry run pytest tests --doctest-modules -v -m 'not dymola' --cov-report term-missing --cov .
- name: Run Pytest (no compilation or simulation)
if: matrix.test_env == 'python' && matrix.os == 'windows-latest'
run: poetry run pytest tests --doctest-modules -v -m 'not simulation and not compilation and not dymola'
- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --all-files
- name: Run mypy
run: |
if [ '${{ matrix.test_env }}' == 'mypy' ]; then
poetry run mypy --install-types --non-interactive --show-error-codes .
fi
if: matrix.test_env =='mypy'
run: poetry run mypy --install-types --non-interactive --show-error-codes .
- name: Build docs
if: matrix.test_env == 'docs'
run: |
if [ '${{ matrix.test_env }}' == 'docs' ]; then
cd docs
poetry run make html
fi
cd docs
poetry run make html
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.test_env == 'python' && matrix.mbl_branch == 'maint_9.1.x' }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.test_env == 'python' }}
run: |
poetry run coveralls
- name: Job Failed
Expand Down
10 changes: 7 additions & 3 deletions geojson_modelica_translator/modelica/lib/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openmodelica/openmodelica:v1.22.0-gui
FROM openmodelica/openmodelica:v1.22.1-gui

# libgfortran4 is needed to load FMU for FMUZoneAdapterZones1.mo
RUN apt update && apt --no-install-recommends install -y \
Expand All @@ -15,5 +15,9 @@ RUN echo \
omc /tmp/installMSL.mos && \
rm /tmp/installMSL.mos

# Put the om.py CLI into the container
COPY ./om.py /mnt/lib/om.py
# Install MBL 9.1.0
# WARNING: Update the version in modelica-builder when updating the version here
RUN echo \
"updatePackageIndex(); getErrorString(); installPackage(Buildings, \"9.1.0\", exactMatch=false); getErrorString();" >> /tmp/installMBL.mos && \
omc /tmp/installMBL.mos && \
rm /tmp/installMBL.mos
176 changes: 0 additions & 176 deletions geojson_modelica_translator/modelica/lib/runner/om.py

This file was deleted.

Loading

0 comments on commit be1e6ef

Please sign in to comment.