-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (71 loc) · 2.05 KB
/
tests.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
name: tests
on:
push:
branches:
- "**"
schedule:
- cron: '0 0 * * 1'
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/dolfinx:v0.7.2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Flake8 checks
run: |
python3 -m flake8 fenicsx_shells
cd demo && python3 -m flake8 . && cd ../
python3 -m flake8 test
- name: isort checks (non-blocking)
continue-on-error: true
run: |
python3 -m isort --check fenicsx_shells
python3 -m isort --check demo
python3 -m isort --check test
- name: Install FEniCSx-Shells
run: |
pip install scikit-build-core[pyproject] # TO REMOVE ONCE 0.8.0 RELEASED
python3 -m pip install --no-build-isolation --check-build-dependencies .
- name: Build documentation
run: |
cd doc
python3 -m sphinx -W -b html source/ build/html/
- name: Run demos
run: |
python3 -m pytest demo
- name: Create documentation artifact
run: |
tar \
--dereference --hard-dereference \
--directory doc/build/html \
-cvf artifact.tar \
--exclude=.git \
--exclude=.github \
.
- name: Upload documentation artifact
uses: actions/upload-artifact@v3
with:
name: github-pages
path: artifact.tar
retention-days: 1
deploy:
needs: build-and-test
if: github.ref == 'refs/heads/main'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1