Skip to content

Workflow updates and artifact uploads #149

Workflow updates and artifact uploads

Workflow updates and artifact uploads #149

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.test-env }}
strategy:
fail-fast: false
matrix:
test-env:
- py310-all
- py311-all
- py312-all
use-mpl:
- "--mpl --mpl-results-path=/tmp/salem-mpl-results"
include:
- test-env: py311-min
use-mpl: ""
- test-env: py311-xr
use-mpl: ""
runs-on: ubuntu-latest
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: ci/requirements-${{ matrix.test-env }}.yml
activate-environment: test_env
auto-activate-base: false
auto-update-conda: true
- name: Install Self
run: pip install -e .
- name: Test
run: |
coverage erase
coverage run --source=./salem --parallel-mode --module pytest ${{ matrix.use-mpl }} --verbose salem
coverage combine
coverage xml
coverage report --skip-covered
env:
MPLBACKEND: agg
COVERAGE_RCFILE: ${{ github.workspace }}/.coveragerc
STATIC_MAP_API_KEY: ${{ secrets.STATIC_MAP_API_KEY }}
- name: Upload Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
COVERALLS_PARALLEL: true
run: coveralls
- name: Upload pytest-mpl artifacts
if: "${{ failure() && matrix.use-mpl != '' }}"
uses: actions/upload-artifact@v4
with:
name: "pytest-mpl-results-${{ matrix.test-env }}"
path: /tmp/salem-mpl-results/
if-no-files-found: ignore
finish-coveralls:
name: Coveralls Finished
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip3 install --upgrade coveralls &&
coveralls --finish