-
Notifications
You must be signed in to change notification settings - Fork 8
103 lines (77 loc) · 2.26 KB
/
ci.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on: [push, pull_request]
jobs:
tests:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[tests]
- name: Run test suite
run: pytest
examples:
name: Run examples
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build #and push
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
tags: aiida_raspa_test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run examples
run: | # Examples stored and copied from .github/workflows/run_examples.sh
export DOCKERID=`docker run -d aiida_raspa_test`
docker exec --tty $DOCKERID wait-for-services
docker logs $DOCKERID
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'cd $HOME; bash run_examples.sh'
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,tests,docs]
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
- name: Build docs
run: |
make -C docs html