Skip to content

Commit

Permalink
run matrix tests on schedule and master push, coverage on pull
Browse files Browse the repository at this point in the history
  • Loading branch information
jlvdb committed Nov 24, 2024
1 parent 228613b commit b9a0a34
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 49 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -U pip
pip install build
pip install -U .
python -m pip install --upgrade pip
pip install --upgrade build
pip install --upgrade .
- name: Build wheel and sdist
run: python -m build --sdist --wheel --outdir dist/
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/run-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: tests

on:
push:
branches:
- main
pull_request:
branches:
- "**"

jobs:
build-n-coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

# --editable seems necessary for codecov
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --editable .[test]
- name: Run tests and coverage
run: python -m pytest tests --cov=src/ --cov-report=xml

- name: Upload to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
28 changes: 0 additions & 28 deletions .github/workflows/run-smoke-tests.yml

This file was deleted.

36 changes: 18 additions & 18 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: tests
name: CI

on:
schedule:
- cron: 0 6 * * 1
push:
branches:
- main
pull_request:
branches:
- "**"

jobs:
build-n-test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- 3.10
- 3.11
- 3.12
- 3.13

steps:
- uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install dependencies on ${{ matrix.python-version }}
run: |
python -m pip install -U pip
pip install -U -e .[test]
- name: Run tests and coverage
run: python -m pytest tests --cov=src/ --cov-report=xml
python -m pip install --upgrade pip
pip install --upgrade .[test]
- name: Upload to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: Run tests on ${{ matrix.python-version }}
run: python -m pytest tests -v

0 comments on commit b9a0a34

Please sign in to comment.