Ensure HDF5 can always be installed in Github Actions #48
This file contains 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
# This file is managed by 'repo_helper'. Don't edit it directly. | |
--- | |
name: mypy | |
on: | |
push: | |
branches-ignore: | |
- 'repo-helper-update' | |
- 'pre-commit-ci-update-config' | |
- 'imgbot' | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
Run: | |
name: "mypy / ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04', 'windows-2019'] | |
fail-fast: false | |
steps: | |
- name: Checkout 🛎️ | |
uses: "actions/checkout@v4" | |
- name: Check for changed files | |
uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
list-files: "json" | |
filters: | | |
code: | |
- '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' | |
- name: Setup Python 🐍 | |
if: steps.changes.outputs.code == 'true' | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.9" | |
- name: Install dependencies (Linux) 🔧 | |
if: ${{ matrix.os == 'ubuntu-20.04' && steps.changes.outputs.code == 'true' }} | |
run: | | |
sudo apt update | |
sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev | |
sudo add-apt-repository universe | |
sudo apt update | |
sudo apt install libhdf5-dev netcdf-bin libnetcdf-dev | |
python -VV | |
python -m site | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade tox~=3.0 virtualenv!=20.16.0 | |
- name: Install dependencies (Windows) 🔧 | |
if: ${{ matrix.os != 'ubuntu-20.04' && steps.changes.outputs.code == 'true' }} | |
run: | | |
python -VV | |
python -m site | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade tox~=3.0 virtualenv!=20.16.0 | |
pip config set global.prefer-binary true | |
- name: "Run mypy" | |
if: steps.changes.outputs.code == 'true' | |
run: "python -m tox -e mypy -s false" |