Files
nexus-sync/.github/workflows/ci.yml
T
2026-06-25 02:39:25 +03:00

79 lines
2.0 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install black>=24.0
- run: black --check src/
typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- run: mypy src/
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- run: pytest
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[docs]"
- run: sphinx-build -b html -W --keep-going docs docs/_build/html
build:
name: Build (${{ matrix.os }})
needs: [format, typecheck, test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
data_sep: ":"
- os: windows-latest
data_sep: ";"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- run: pybabel compile -d src/nexus_sync/locale -D nexus
- run: pyinstaller --onefile src/nexus_sync/client/__main__.py --name nexus-sync-client
- run: pyinstaller --onefile src/nexus_sync/server/__main__.py --name nexus-sync-server
- run: pyinstaller --onefile src/nexus_sync/cli/__main__.py --name nexus-cli --add-data "src/nexus_sync/locale${{ matrix.data_sep }}nexus_sync/locale"
- uses: actions/upload-artifact@v4
with:
name: nexus-sync-${{ matrix.os }}
path: dist/