remove unnecessary config option #3097
This file contains hidden or 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: | |
# re-enable all branches until we start simulating again. | |
# branches: | |
# - 'develop' | |
# - 'main' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.10", "3.13"] | |
test_env: [python, mypy] | |
mbl_tag: [v12.1.0] | |
exclude: | |
# only test mypy on linux for all versions of python | |
- os: windows-latest | |
test_env: mypy | |
runs-on: ${{ matrix.os }} | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display system info | |
run: | | |
python -c "import sys; print(sys.version)" | |
docker --version | |
docker compose version | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v4 | |
with: | |
poetry-version: "latest" | |
- name: Install dependencies with Poetry | |
# poetry setuptools workaround sourced from https://github.com/python-poetry/poetry/issues/7611#issuecomment-1711443539 | |
run: | | |
poetry --version | |
poetry self add setuptools | |
poetry install | |
- name: Install modelicafmt | |
run: | | |
RUNNER_SYSTEM=$(python -c 'import platform; print(platform.system())') | |
curl -SLO "https://github.com/urbanopt/modelica-fmt/releases/download/v0.2-pr.2/modelica-fmt_0.2-pr.2_${RUNNER_SYSTEM}_x86_64.tar.gz" | |
tar --exclude='README.md' --exclude='CHANGELOG.md' -xzf modelica-fmt_0.2-pr.2_${RUNNER_SYSTEM}_x86_64.tar.gz | |
chmod +x modelicafmt | |
if [[ $RUNNER_SYSTEM == 'Linux' ]]; then | |
sudo mv modelicafmt /usr/local/bin/ | |
else | |
mv modelicafmt '/c/Program Files/' | |
fi | |
- name: Allow long filenames in Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
git config --system core.longpaths true | |
- name: Install MBL | |
uses: actions/checkout@v5 | |
with: | |
repository: lbl-srg/modelica-buildings | |
ref: ${{ matrix.mbl_tag }} | |
path: modelica-buildings | |
- name: Set MODELICAPATH | |
run: | | |
MODELICAPATH="${{ github.workspace }}/modelica-buildings" | |
cd "${MODELICAPATH}" | |
echo "Git branch is $(git branch)" | |
# export MODELICAPATH for subsequent steps | |
echo "MODELICAPATH=${MODELICAPATH}" >> $GITHUB_ENV | |
- name: Run pytest (including simulations) | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
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 | |
run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files | |
- name: Run mypy | |
if: matrix.test_env =='mypy' | |
run: poetry run mypy --exclude='modelica-buildings/' --install-types --non-interactive --show-error-codes . | |
- name: Job Failed | |
if: ${{ failure() }} | |
run: | | |
echo "Maybe these logs will help?" | |
ls -alt $GITHUB_WORKSPACE | |
find $GITHUB_WORKSPACE -type f -name 'stdout.log' -print | while read filename; do | |
echo "============================================ stdout.log =========================================" | |
echo "$filename" | |
cat "$filename" | |
done |