Skip to content

Merge pull request #13 from nasa/build/switch-actions-to-uv #2

Merge pull request #13 from nasa/build/switch-actions-to-uv

Merge pull request #13 from nasa/build/switch-actions-to-uv #2

Workflow file for this run

# A reusable workflow to build and run the unit test suite
#
# This workflow will install Python dependencies, run tests,
# and report test results and code coverage as artifacts. It will
# be called by the workflow that run tests against new PRs and as
# a first step in the workflow that publishes new Docker images.
name: Unit Tests
on:
push:
workflow_dispatch:
env:
PYTHON_VERSION: "3.12"
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Retrieve repository
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --extra dev --extra harmony --frozen
- name: Run linting
run: |
uv run ruff check casper
- name: Run tests and collect coverage
run: uv run pytest --cov=casper --cov-report=xml tests/unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: unittests