Skip to content

Commit

Permalink
run tests on python 3.9-12, run tests every mon, rename to test.yml, …
Browse files Browse the repository at this point in the history
…upload to codecov
  • Loading branch information
erexer committed Oct 28, 2024
1 parent d478340 commit a0e1623
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 37 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/build.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: test

on:
push:
branches: # on all branches except `typos`
- '**'
- '!typos'
paths-ignore:
- 'docs/**'
- 'notebooks/**'
- 'paper/**'
- '.git*'
- 'README.md'
pull_request:
branches:
- '**'
schedule: # Every Monday at 07:00 UTC, 00:00 PT
- cron: '0 7 * * 1'

jobs:
build:
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [ubuntu-latest]
fail-fast: false

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -c 'import cerf; cerf.install_package_data()'
- name: Test and generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v4
with:
files: ./coverage.xml # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required

- name: Notify on failure
if: failure() # This step will only run if any previous step fails
run: |
echo "Build or tests failed. Please check the logs."

0 comments on commit a0e1623

Please sign in to comment.