Skip to content

Python application #5227

Python application

Python application #5227

Workflow file for this run

name: Python application
on:
push:
paths-ignore:
- "docs/**"
- "examples/**"
- "scripts/**"
- "nix/**"
- "tests_staging/**"
- "deprecated/**"
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
jobs:
buildNix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
extra_nix_config: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
with:
name: pysisyphus
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix flake --allow-import-from-derivation check
- run: nix build --print-build-logs
- run: nix develop --command echo ""
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9.15
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install pysisyphus and dependencies required for testing
run: |
python -m pip install -e .[test] -r test-requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install thermoanalysis
run: |
pip install git+https://github.com/eljost/thermoanalysis.git
- name: Install geodesic-interpolate
run: |
pip install git+https://github.com/virtualzx-nad/geodesic-interpolate.git
- name: Test with pytest
run: >
pytest -v
--cov=pysisyphus --cov-config .coveragerc --cov-report xml --cov-report term
--show-capture=no
--durations=0
-m "not benchmark and not skip_ci"
tests
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests