tests #196
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: 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.8.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: ruff checks | |
run: | | |
ruff check . | |
ruff format --check . | |
- name: Install FEniCSx-Shells | |
run: | | |
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 |