Skip to content

structlog

structlog #33

Workflow file for this run

name: CI Pipeline
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
codestyle:
name: ruff codestyle check/linting
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: install ruff
run: pip install ruff
- name: run ruff linter
run: ruff check hololinked
test:
name: unit-integration tests
needs: codestyle
strategy:
matrix:
include:
- os: windows-latest
python-version: 3.11
- os: windows-latest
python-version: 3.12
- os: windows-latest
python-version: 3.13
# - os: macos-latest
# python-version: 3.11
- os: ubuntu-latest
python-version: 3.11
- os: ubuntu-latest
python-version: 3.12
- os: ubuntu-latest
python-version: 3.13
runs-on: ${{ matrix.os }}
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: install uv (linux/macOS)
if: runner.os != 'Windows'
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: install uv (windows)
if: runner.os == 'Windows'
run: |
python -m pip install uv
- name: install dependencies (linux/macOS)
if: runner.os != 'Windows'
run: |
uv venv .venv
source .venv/bin/activate
uv sync --no-install-project --group test --group dev
- name: install dependencies (windows)
if: runner.os == 'Windows'
run: |
uv venv .venv
.venv\Scripts\activate
uv sync --no-install-project --group test --group dev
- name: run unit tests (linux/macOS)
if: runner.os != 'Windows' && matrix.python-version != 3.13
run: |
source .venv/bin/activate
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
- name: run unit tests (Windows)
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
uv run coverage run -m unittest discover -s tests -p "test_*.py"
- name: run unit tests and generate coverage report (linux/macOS python 3.13)
if: runner.os != 'Windows' && matrix.python-version == 3.13
run: |
source .venv/bin/activate
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
uv run coverage xml -o coverage.xml
- name: upload coverage report as artifact
uses: actions/upload-artifact@v4
if: runner.os != 'Windows' && matrix.python-version == 3.13
with:
name: coverage-report-ubuntu-latest-py3.13
path: coverage.xml
if-no-files-found: warn
publish_coverage:
name: publish coverage
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: checkout code
uses: actions/checkout@v4
- name: download coverage artifact
id: dl
uses: actions/download-artifact@v4
with:
name: coverage-report-ubuntu-latest-py3.13
path: .
continue-on-error: true
- name: upload coverage to codecov
if: steps.dl.outcome == 'success'
uses: codecov/codecov-action@v4
env:
CI: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
slug: hololinked-dev/hololinked
- name: skip note (no artifact found)
if: steps.dl.outcome != 'success'
run: echo "No coverage artifact present; skipping codecov upload."