Move tutorials before running them on CI #410
Workflow file for this run
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: RBniCS CI | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: numericalpdes/base_images:fenics-real | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install RBniCS | |
run: pip install .[tests] | |
- name: Run unit tests | |
run: pytest -svv tests/unit | |
- name: Run performance tests | |
run: pytest --benchmark-disable -svv tests/performance | |
- name: Run tutorials | |
run: | | |
cd tutorials | |
mkdir to_run | |
cp -rf 01_thermal_block/tutorial_thermal_block.ipynb 02_elastic_block/tutorial_elastic_block.ipynb 03_hole/tutorial_hole.ipynb 05_gaussian/tutorial_gaussian_eim.ipynb to_run | |
mkdir to_run/data | |
cp -rf 01_thermal_block/data/* 02_elastic_block/data/* 03_hole/data/* 05_gaussian/data/* to_run/data | |
pytest -svv to_run | |
docker: | |
if: github.repository == 'RBniCS/RBniCS' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: [test] | |
env: | |
RELEASE_IMAGE: rbnics/rbnics:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the docker release image | |
run: docker build --pull -t ${RELEASE_IMAGE} -f docker/Dockerfile.dolfin . | |
- name: Try importing the library inside the docker image | |
run: docker run -i --rm ${RELEASE_IMAGE} python3 -c 'import dolfin; import rbnics' | |
- name: Run unit tests to verify that the docker image is working | |
run: docker run -i --rm ${RELEASE_IMAGE} bash -c "cd RBniCS && pytest -svv tests/unit" | |
- name: Log into the docker registry | |
run: docker login -u ${{ secrets.CI_REGISTRY_USER }} -p ${{ secrets.CI_REGISTRY_PASSWORD }} | |
- name: Push to the docker registry | |
run: docker push ${RELEASE_IMAGE} |