bump: version 2.0.1 → 2.1.0 #49
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: Test code | |
on: | |
push: | |
branches: [ '*' ] | |
# paths: [ '**.py' ] | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: ["ubuntu", "macos", "windows"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install regular dependencies with conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: "latest" | |
environment-file: environment.yml | |
activate-environment: test-env | |
conda-remove-defaults: "true" | |
- name: Install dev dependencies with conda | |
run: | | |
conda env update -n test-env --file environment-dev.yml | |
- name: Install as package | |
run: | | |
pip -v install --no-deps --editable . | |
- name: Run tests with coverage | |
run: | | |
coverage run -m pytest -xs | |
- name: Generate coverage report | |
if: matrix.os == 'ubuntu' | |
run: | | |
coverage report --format markdown > coverage.md | |
- name: Extract coverage percentage | |
if: matrix.os == 'ubuntu' | |
run: | | |
export COV_PERCENT=$(coverage report --format total) | |
echo "COV_PERCENT=$COV_PERCENT" >> $GITHUB_ENV | |
- name: Create Coverage Badge | |
if: matrix.os == 'ubuntu' | |
uses: schneegans/dynamic-badges-action@v1.7.0 | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 056fdf29a6c0ab5b61a62f21468be178 | |
filename: molecule-signature-coverage.json | |
label: coverage | |
message: ${{ env.COV_PERCENT }}% | |
valColorRange: ${{ env.COV_PERCENT }} | |
minColorRange: 50 | |
maxColorRange: 90 | |
- name: Upload coverage report | |
if: matrix.os == 'ubuntu' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: coverage.md | |
compression-level: 0 |