-
Notifications
You must be signed in to change notification settings - Fork 12
76 lines (71 loc) · 2.5 KB
/
patch_test.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
# Workflow runs simple package installation & unittest.
# All python unittests should be relatively fast (1 core + gam)
name: Unit tests
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'examples/**'
- 'tutorials/**'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
basic:
defaults:
run:
shell: bash
runs-on: ubuntu-latest
container:
image: ulissigroup/kubeflow_vasp:extras-notebook
env:
VASP_PREFIX: "mpirun -np 1 --mca btl_vader_single_copy_mechanism none --mca mpi_cuda_support 0 --allow-run-as-root"
options: --user root --entrypoint /bin/bash
credentials:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
vasp-version: ["vasp54", "vasp61", "vasp62", "vasp63"]
variant: ["patch", "pristine"]
steps:
- name: check env
run: |
echo "${{ github.workspace }}"
- uses: actions/checkout@v2
- name: Download test binaries
run: |
wget --no-verbose https://github.com/ulissigroup/vasp-interactive/releases/download/v0.0.1/test_binaries.zip
unzip -d vasp -P $MYPWD test_binaries.zip
VASP_ROOT=`realpath vasp`
echo "VASP_ROOT=${VASP_ROOT}" >> $GITHUB_ENV
env:
MYPWD: ${{ secrets.TEST_BINARY_KEY }}
- name: setup conda version
run: |
conda create --name actions -c conda-forge \
python=${{ matrix.python-version }} pip flake8 pytest
conda init bash
source activate actions
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
source activate actions
which python
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: Package install
run: |
source activate actions
python -m pip install --upgrade .
- name: Unit test
run: |
source activate actions
echo ${VASP_ROOT}
export VASP_COMMAND="${VASP_PREFIX} ${VASP_ROOT}/${{ matrix.variant }}/${{ matrix.vasp-version }}/bin/vasp_std"
echo $VASP_COMMAND
for f in tests/test*.py; do echo $f; python -m pytest -s $f; killall vasp_std || echo ""; done