-
Notifications
You must be signed in to change notification settings - Fork 29
106 lines (100 loc) · 3.05 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
104
105
106
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: nvm
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
- uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: npm install
- run: npm run build
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install wheel
- run: python setup.py bdist_wheel
- uses: actions/upload-artifact@v1
with:
name: bdist-wheel-package
path: dist
- uses: actions/upload-artifact@v1
with:
name: static-files
path: sphinx_wagtail_theme/static/dist/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: make setup
- run: make install-for-development
- run: make lint-minimal
- run: npm run lint
- run: make test
visual-regression-tests:
runs-on: ubuntu-latest
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Firefox and geckodriver
uses: ./.github/actions/setup-firefox
- run: make setup
- run: make install-for-development
- run: make frontend
- run: make docs
- name: Percy Test
run: make test-visual-regression
sphinx-quickstart:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: bdist-wheel-package
path: packages
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install sphinx
- run: pip install $(find packages -name "*.whl")
- name: Assert is importable, show version
run: python -c "import sphinx_wagtail_theme; print(sphinx_wagtail_theme.__version__)"
- run: |
html_theme=sphinx_wagtail_theme
sphinx-quickstart --project PROJECT --author AUTHOR --sep \
--extensions ${html_theme} --no-use-make-mode --quiet
echo >> source/conf.py
echo 'extensions.append("'${html_theme}'")' >> source/conf.py
echo 'html_theme = "'${html_theme}'"' >> source/conf.py
cat source/conf.py
sphinx-build -b html -A version=test source build
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
with:
name: static-files
path: sphinx_wagtail_theme/static/dist/
- run: grep -F -v 'dist' .gitignore > .gitignore.tmp && mv .gitignore.tmp .gitignore
- uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: .
clean: true