-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (70 loc) · 2.33 KB
/
python-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 12 * * 1'
permissions:
contents: read
defaults:
run:
shell: bash -el {0} # Lets conda work
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
max-parallel: 5
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: ${{ matrix.os == 'ubuntu-latest' && 'envs/environment-cpu.yml' || 'envs/environment-macos.yml' }}
activate-environment: test
auto-activate-base: true
auto-update-conda: false
remove-profiles: true
architecture: x64
clean-patched-environment-file: true
run-post: true
use-mamba: true
miniforge-version: latest
- name: Display Environment
run: conda list
- name: Install test dependencies
run: |
pip install -e .[test]
- name: Lint with flake8
run: |
pip install flake8
flake8 examol tests
- name: Add quantum chemistry tools (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# CP2K package has disappeared as of 21Jan25
# sudo apt update
# sudo apt install -y cp2k lammps
# Link the cp2k.ssmp executable to the cp2k_shell needed for ASE
mkdir -p bin
cp2k_path=`which cp2k.ssmp`
export CP2K_DATA_DIR=`which cp2k.ssmp | xargs dirname`/../share/cp2k/data/
echo -e "#!/bin/bash\nCP2K_DATA_DIR=$CP2K_DATA_DIR `which cp2k.ssmp` --shell \$@" > bin/cp2k_shell
chmod u+x bin/cp2k_shell
cat `which cp2k_shell`
echo -n | ./bin/cp2k_shell --version
- name: Run example
run: examol run examples/redoxmers/spec.py:spec
- name: Test with pytest
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pytest --cov=examol --timeout=300 tests
- name: Coveralls
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}