Bump actions/upload-artifact from 3 to 4 #816
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 workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
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: | |
PY_COLORS: '1' | |
CP2K_VERSION: '2023.1' | |
jobs: | |
build: | |
name: ${{ matrix.os }} (py ${{ matrix.version }}${{ matrix.special }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-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: '; minimum version' | |
version: '3.8' | |
env: | |
CP2K_DATA_DIR: /usr/share/cp2k/data | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install CP2K | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
curl -Lsf "https://github.com/cp2k/cp2k/releases/download/v${CP2K_VERSION}/cp2k-${CP2K_VERSION}-Linux-gnu-x86_64.ssmp" -o /usr/local/bin/cp2k.ssmp | |
chmod u+rx /usr/local/bin/cp2k.ssmp | |
- name: Info CP2K | |
if: matrix.os == 'ubuntu-latest' | |
run: cp2k.ssmp --version | |
- name: Install dependencies | |
run: | | |
if [[ "${{ matrix.special }}" == '; pre-release' ]]; then | |
pip install --pre -e .[test-no-optional] --upgrade --force-reinstall | |
pip install git+https://github.com/SCM-NV/qmflows@master --upgrade | |
pip install git+https://github.com/SCM-NV/PLAMS@master --upgrade | |
pip install git+https://github.com/NLeSC/noodles@master --upgrade | |
elif [[ $SPECIAL"${{ matrix.special }}" == '; minimum version' ]]; then | |
pip install -r ./test_requirement_min_version.txt | |
pip install -e .[test-no-optional] | |
else | |
pip install -e .[test] | |
fi | |
pip install https://github.com/nlesc-nano/auto-FOX-data/releases/download/1.2.0/Auto_FOX_Data-1.2.0-py3-none-any.whl | |
- name: Info Python | |
run: | | |
which python | |
python --version | |
- name: Info installed packages | |
run: pip list | |
- name: Run tests | |
run: pytest -m "not slow" | |
- name: Run codecov | |
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 on ubuntu-latest | |
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 FOX tests | |
- name: Run pydocstyle | |
run: pydocstyle FOX |