73 lines
1.5 KiB
YAML
73 lines
1.5 KiB
YAML
# .github/workflows/ci.yml
|
|
name: CI/CD Pipeline
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
python-version: [3.13]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
|
|
- name: Run tests
|
|
run: poetry run pytest
|
|
|
|
- name: Run linting
|
|
run: |
|
|
poetry run flake8 src/
|
|
poetry run black --check src/
|
|
poetry run mypy src/
|
|
|
|
build:
|
|
needs: test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.13
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Generate lock file
|
|
run: poetry lock
|
|
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
|
|
- name: Build application
|
|
run: |
|
|
# Set environment variable for CI mode
|
|
export CI_MODE=true
|
|
poetry run python src/main.py
|
|
env:
|
|
CI_MODE: "true"
|
|
|
|
- name: Build complete
|
|
run: echo "Build process completed successfully" |