Skip to content

reduce github actions credits of the CI/CD #40

reduce github actions credits of the CI/CD

reduce github actions credits of the CI/CD #40

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v7
- uses: j178/prek-action@v2
- name: Run Pylint
run: uvx nox -s pylint -- --output-format=github
test:
name: Test (Python 3.10)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v7
- name: Install package
run: uv sync
- name: Test package
run:
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
pass:
if: always()
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- name: Check status
run: |
if [ "${{ needs.lint.result }}" != "success" ] || [ "${{ needs.test.result }}" != "success" ]; then
exit 1
fi