From 034a101aba4492c197c37ac098e22b45665e00b0 Mon Sep 17 00:00:00 2001 From: Nathan Moore Date: Fri, 22 Dec 2023 09:27:45 -0700 Subject: [PATCH] use GHA-style if-syntax --- .github/workflows/ci.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1ca53416..0d5bb1339 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,38 +74,31 @@ jobs: 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 - poetry run pytest --doctest-modules -v -m 'not dymola' --cov-report term-missing --cov . ./tests - 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 --doctest-modules -v -m 'not dymola' --cov-report term-missing --cov . ./tests + - name: Run Pytest (no compilation or simulation) + if: matrix.test_env == 'python' && matrix.os == 'windows-latest' + run: poetry run pytest --doctest-modules -v -m 'not simulation and not compilation and not dymola' ./tests - name: Run pre-commit uses: pre-commit/action@v3.0.0 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