63 lines
1.5 KiB
YAML
63 lines
1.5 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
|
|
|
|
build:
|
|
name: Build (${{ matrix.os }})
|
|
needs: [format, typecheck, test]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
- run: pip install -e ".[dev]"
|
|
- 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
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: nexus-sync-${{ matrix.os }}
|
|
path: dist/
|