Skip to content

Instantly share code, notes, and snippets.

@r-leyshon
Created April 19, 2024 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-leyshon/74b78bcbe60ad5cb8743d94e7299dc63 to your computer and use it in GitHub Desktop.
Save r-leyshon/74b78bcbe60ad5cb8743d94e7299dc63 to your computer and use it in GitHub Desktop.
Breaking changes to codecov-action means CODECOV_TOKEN needs to be set on open repos.
name: API workflow
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
name: Test python API
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python 3.12.1
uses: actions/setup-python@v4
with:
python-version: '3.12.1'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests and collect coverage
run: |
coverage run -m pytest
coverage xml
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment