forked from libAtoms/ExPyRe
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (71 loc) · 3.5 KB
/
build.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
79
80
81
82
83
84
85
86
87
88
89
name: Build and test
# on all push actions AND can be triggered manually as well
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies and expyre
run: |
pip install flake8 pytest pytest-cov
- name: Install and configure slurm and ExPyRe
run: |
sudo apt-get install -u slurm-wlm mailutils
echo "SLURM apt-get done, doing local configuration"
host_s=$( hostname -s )
if [ -f /etc/slurm/slurm.conf ]; then sudo mv /etc/slurm/slurm.conf /etc/slurm/slurm.conf.orig; fi
sudo bash -c 'gzip -cd /usr/share/doc/slurmd/examples/slurm.conf.simple.gz > /etc/slurm/slurm.conf'
# sudo sed -E -i -e "s/^\s*ClusterName\s*=.*/ClusterName=github_expyre_test/" /etc/slurm/slurm.conf
sudo bash -c 'sed -E -i -e "s/^\s*SlurmctldHost\s*=.*/SlurmctldHost=_HOST_/" /etc/slurm/slurm.conf'
# sudo sed -E -i -e "s/^\s*DefaultStorageHost\s*=.*/DefaultStorageHost=none" /etc/slurm/slurm.conf
sudo bash -c 'echo "NodeName=_HOST_ CPUs=2 Weight=1 Sockets=1 CoresPerSocket=2 ThreadsPerCore=1 RealMemory=1000" >> /etc/slurm/slurm.conf'
sudo bash -c 'echo "PartitionName=standard Default=YES AllocNodes=_HOST_ Nodes=ALL State=UP" >> /etc/slurm/slurm.conf'
sudo sed -i -e "s/_HOST_/$host_s/g" /etc/slurm/slurm.conf
sudo mkdir -p /var/log/slurm
sudo mkdir -p /var/spool/slurmd
sudo service slurmd start
sudo service slurmctld start
sleep 5
echo "sinfo -s --long"
sinfo -s --long
mkdir $HOME/.expyre
cp .github/workflows_assets/config.json $HOME/.expyre
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 expyre/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 expyre/ --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
# - name: Test with pytest - no coverage
# run: |
# # env EXPYRE_PYTEST_SYSTEMS=github EXPYRE_PYTEST_MAX_NUM_NODES=1 pytest -v --clean -rxXs --basetemp $HOME/pytest
# env EXPYRE_PYTEST_SYSTEMS=github EXPYRE_PYTEST_MAX_NUM_NODES=1 pytest -v --clean -rxXs --basetemp $HOME/pytest
- name: Test with pytest - coverage
run: |
env EXPYRE_PYTEST_QUEUED_JOB_RESOURCES=$PWD/.github/workflows_assets/EXPYRE_PYTEST_QUEUED_JOB_RESOURCES.json EXPYRE_PYTEST_SYSTEMS=github EXPYRE_PYTEST_MAX_NUM_NODES=1 pytest -v --cov=expyre --cov-report term --cov-report html --cov-config=tests/.coveragerc --cov-report term-missing --cov-report term:skip-covered --clean -rxXs --basetemp $HOME/pytest
# - name: Upload Coverage Data
# uses: actions/upload-artifact@v2
# with:
# name: coverage-html
# path: coverage-html/
# retention-days: 7
docs:
runs-on: ubuntu-latest
needs: build
# if: github.ref == 'refs/heads/public'
steps:
- uses: actions/checkout@v2
- name: Build documentation
run: |
pip install sphinx sphinx-book-theme docutils==0.16 sphinx-click
pip install --upgrade jinja2
cd docs
make html
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html