Use pytest for unit testing #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| # tests can be called from other workflows | |
| workflow_call: | |
| # always run tests for every push to master | |
| push: | |
| branches: [master] | |
| # always run tests for every PR | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| prek: | |
| name: Run code checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: j178/prek-action@v1 | |
| unittest: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: uv sync --no-dev | |
| - name: Run unit tests | |
| run: uv run pytest --cov=src/signalbot |