tracker/.github/workflows/ci.yml
m1ngsama 9fe4543aa6 optimize: improve build profile, CI, and remove redundant cpu sleeps
- Add release profile with LTO and stripping for smaller binaries
- Add Rust checks (fmt, clippy, test) to CI
- Remove redundant 200ms sleep in cpu monitoring for better continuous performance
- Fix dead code warnings in various modules
2025-12-16 17:49:15 +08:00

78 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python test_tracker.py
- name: Test basic execution
run: |
python tracker.py
timeout-minutes: 1
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install flake8 pylint
- name: Lint with flake8
run: |
# Stop build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
rust-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test