Skip to content

feat: update ETF portfolio deposit file structure and tests for new c… #25

feat: update ETF portfolio deposit file structure and tests for new c…

feat: update ETF portfolio deposit file structure and tests for new c… #25

Workflow file for this run

name: CI
on:
pull_request:
branches: [ main, master, develop, 'feat/**' ]
push:
branches: ['**']
workflow_dispatch:
jobs:
# PR: quick lint check (check-only)
lint-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Check linting with Ruff
run: |
ruff check --config pyproject.toml .
- name: Check formatting with Ruff
run: |
ruff format --check --config pyproject.toml .
# Push: auto-fix and commit
lint-fix:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff linting with auto-fix
run: |
ruff check --fix --config pyproject.toml .
- name: Run Ruff formatting
run: |
ruff format --config pyproject.toml .
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: auto-format code with Ruff [skip ci]"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
# PR: full matrix tests (comprehensive compatibility check)
test-full:
if: github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
needs: lint-check
strategy:
fail-fast: false
matrix:
include:
# 1. Backward compatibility (LTS users)
- os: ubuntu-latest
python-version: "3.10"
# 2. Mainstream (most users, cross-platform)
- os: ubuntu-latest
python-version: "3.11"
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
# 3. Latest/future (experimental features / performance)
- os: ubuntu-latest
python-version: "3.13"
- os: ubuntu-latest
python-version: "3.14"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Run tests with pytest
run: |
pytest -v --cov=pykrx --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
with:
file: ./coverage.xml
fail_ci_if_error: false
# Push: quick test (single environment for fast feedback)
test-quick:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: lint-fix
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Run tests with pytest
run: |
pytest -v --cov=pykrx --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false