Merge pull request #255 from ComputationalPhysiology/dependabot/githu… #1042
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] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
id: cache-primes | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/instant | |
~/.cache/dijitso | |
~/.cache/pip | |
key: cache_v5 | |
restore-keys: | | |
cache_v5 | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install h5py --no-binary=h5py | |
python3 -m pip install -e ".[dev]" | |
- name: Test with pytest | |
run: | | |
python3 -m pytest | |
- name: Extract Coverage | |
run: | | |
python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY | |
python3 -m coverage json | |
export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
echo "total=$TOTAL" >> $GITHUB_ENV | |
- name: Upload HTML report. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-report | |
path: htmlcov | |
- name: Install pypa/build | |
run: >- | |
python3 -m | |
pip install | |
build | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python3 -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |