Skip to content

Commit

Permalink
TST,STY: Replace bash if statements with case
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas van Beek committed Oct 16, 2021
1 parent 90094b3 commit adcbcd8
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down

0 comments on commit adcbcd8

Please sign in to comment.