Update frontend tooling to use Node 20 (#273) #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |