Skip to content

updated doc and CI build for linux #46

updated doc and CI build for linux

updated doc and CI build for linux #46

name: CI-LINUX
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
tests:
name: "Tests on ${{ matrix.os }} Python ${{ matrix.python-version }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.11"
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./installation/sira_env.yml
environment-name: sira_env
create-args: >-
python=${{ matrix.python-version }}
libtiff
libpng
cache-environment: true
- name: Install uv and requirements
shell: bash -l {0}
run: |
micromamba activate sira_env
pip install uv
uv pip install -r ./installation/sira_req.txt
- name: Run pytest
shell: bash -l {0}
run: |
micromamba activate sira_env
pytest
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
if-no-files-found: ignore
coverage:
name: Coverage
needs: tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: |
python -m pip install tox tox-gh-actions
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
- name: Combine coverage
run: |
python -Im pip install --upgrade coverage[toml]
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
python -m tox -e coverage
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report if check had failed
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
if: ${{ failure() }}