Merge pull request #204 from nasa/pre-commit-ci-update-config #34
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
| # 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 runs tests against new PRs and as | |
| # a first step in the workflow that publishes new Docker images. | |
| # Runs linting and unit tests on push, and reports | |
| # code coverage to Codecov. | |
| name: Run tests and linting | |
| on: | |
| push: | |
| workflow_call: | |
| secrets: | |
| codecov_token: | |
| required: true | |
| workflow_dispatch: | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| run_tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| 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 --frozen | |
| - name: Run Linting | |
| run: | | |
| uv run ruff check batchee | |
| - name: Run tests with coverage | |
| run: | | |
| uv run pytest --cov=batchee --cov-report=xml:build/reports/coverage.xml tests/ | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true |