-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (56 loc) · 1.56 KB
/
main.yaml
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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10' ]
steps:
- uses: actions/checkout@v3
- name: Cache test fixtures
id: cache-test-fixtures
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/tests/fixtures/wannier90-*
key: ${{ runner.os }}-${{ hashFiles('tests/fixtures/*') }}_0
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements/dev-requirements.txt
pip install .
- name: Make fixtures
if: steps.cache-test-fixtures.outputs.cache-hit != 'true'
run: |
make -C ./tests/fixtures
- name: Run tests
run: |
pytest -v
docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install -r requirements/dev-requirements.txt
pip install .
- name: Build docs
run: |
mkdocs build
- name: Publish docs
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/
force_orphan: true