From adcbcd8e01bdba730c9381a523e9fbd50c1481d3 Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Sat, 16 Oct 2021 13:30:02 +0200 Subject: [PATCH] TST,STY: Replace bash `if` statements with `case` --- .github/workflows/pythonpackage.yml | 30 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 117141b..c2e78c0 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -44,16 +44,15 @@ jobs: - name: Install dependencies shell: bash - env: - SPECIAL: ${{ matrix.special }} run: | - if [[ $SPECIAL == '; no-optional' ]]; then - pip install -e .[test_no_optional] - elif [[ $SPECIAL == '; pre-release' ]]; then - pip install --pre -e .[test] --upgrade --force-reinstall - else - pip install -e .[test] - fi + case "${{ matrix.special }}" in + "; no-optional") + pip install -e .[test_no_optional] ;; + "; pre-release") + pip install --pre -e .[test] --upgrade --force-reinstall ;; + *) + pip install -e .[test] ;; + esac - name: Python info run: | @@ -65,14 +64,13 @@ jobs: - name: Test with pytest shell: bash - env: - SPECIAL: ${{ matrix.special }} run: | - if [[ $SPECIAL == '; no-optional' ]]; then - pytest --mypy - else - pytest --mypy --doctest-modules - fi + case "${{ matrix.special }}" in + "; no-optional") + pytest --mypy ;; + *) + pytest --mypy --doctest-modules ;; + esac - name: Run codecov uses: codecov/codecov-action@v2