Bump actions/upload-artifact from 3 to 4 #682
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
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
CP2K_DATA_DIR: "${{ github.workspace }}/cp2k/data" | |
PY_COLORS: "1" | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
version: ['3.8', '3.9', '3.10', '3.11'] | |
special: [''] | |
include: | |
- os: ubuntu-latest | |
special: ['pre-release'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['no optional'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['no optional'] | |
version: '3.12' | |
- os: ubuntu-latest | |
special: ['CP2K', '6.1', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '7.1', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '8.2', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '9.1', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '2022.1', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '2023.1', 'ssmp'] | |
version: '3.11' | |
- os: macos-latest | |
special: ['CP2K', '2023.1', 'ssmp'] | |
version: '3.11' | |
- os: ubuntu-latest | |
special: ['CP2K', '2023.1', 'psmp'] | |
version: '3.11' | |
- os: macos-latest | |
special: ['CP2K', '2023.1', 'psmp'] | |
version: '3.11' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install cp2k | |
if: matrix.special[0] == 'CP2K' | |
run: bash scripts/download_cp2k.sh x86_64 ${{ matrix.special[1] }} ${{ matrix.os }} ${{ matrix.special[2] }} | |
- name: Info CP2K | |
if: matrix.special[0] == 'CP2K' | |
run: cp2k.${{ matrix.special[2] }} --version | |
- name: Info MPI | |
if: matrix.special[2] == 'psmp' | |
run: mpirun --version | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.version }} | |
# TODO: Remove the manual h5py building once h5py 3.10 has been released with cp312 wheels | |
- name: Install dependencies | |
run: | | |
case "${{ matrix.special[0] }}" in | |
"pre-release") | |
pip install --pre -e .[test] --upgrade --force-reinstall | |
pip install git+https://github.com/NLeSC/noodles@master --upgrade | |
;; | |
"no optional") | |
if [[ "${{ matrix.version }}" == '3.12' ]]; then | |
sudo apt-get update | |
sudo apt-get install libhdf5-dev | |
pip install git+https://github.com/h5py/h5py@89e1e2e78d7fb167d2a67c9a8354ced6491160fe | |
fi | |
pip install -e .[test-no-optional] | |
;; | |
*) | |
pip install -e .[test] | |
;; | |
esac | |
- name: Python info | |
run: | | |
which python | |
python --version | |
- name: Installed packages | |
run: pip list | |
- name: Test with pytest | |
run: | | |
case "${{ matrix.special[0] }}" in | |
"no optional") | |
pytest -m 'not (slow or long)' test ;; | |
"CP2K") | |
if [[ "${{ matrix.special[2] }}" == 'psmp' ]]; then | |
export QMFLOWS_CP2K_COMMAND='mpirun cp2k.psmp' | |
fi | |
if [[ "${{ matrix.os }}" == 'macos-latest' ]]; then | |
export VECLIB_MAXIMUM_THREADS=1 | |
fi | |
pytest -m '(slow or long)' ;; | |
*) | |
pytest -m 'not (slow or long)' ;; | |
esac | |
- uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
name: codecov-umbrella | |
Linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install linters | |
run: pip install .[lint] | |
- name: Python info | |
run: | | |
which python | |
python --version | |
- name: Installed packages | |
run: pip list | |
- name: Run flake8 | |
run: flake8 src test conftest.py | |
- name: Run pydocstyle | |
run: pydocstyle src | |
- name: Run mypy | |
run: mypy src | |
continue-on-error: true |