Skip to content

tests

tests #119

Workflow file for this run

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