mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-03-28 17:42:56 +01:00
92 lines
2.1 KiB
YAML
92 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "src/**"
|
|
- "tests/**"
|
|
- "alembic/**"
|
|
- ".python-version"
|
|
- "pyproject.toml"
|
|
- ".pre-commit-config.yaml"
|
|
- ".github/workflows/**"
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version-file: ".python-version"
|
|
|
|
- name: Run pre-commit
|
|
uses: pre-commit/action@v3.0.1
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version-file: ".python-version"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e ".[dev]"
|
|
|
|
- name: Run tests with pytest
|
|
run: |
|
|
pytest --cov=meshcore_hub --cov-report=xml --cov-report=term-missing --junitxml=junit.xml -o junit_family=legacy
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
if: always()
|
|
with:
|
|
files: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
verbose: true
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
- name: Upload test results to Codecov
|
|
uses: codecov/test-results-action@v1
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
build:
|
|
name: Build Package
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version-file: ".python-version"
|
|
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dist
|
|
path: dist/
|