Skip to content

feat: fast bump for frontend #261

feat: fast bump for frontend

feat: fast bump for frontend #261

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: ci
on:
push:
branches: [ "main", "dev" ]
paths-ignore:
- "*.md"
pull_request:
branches: [ "main" ]
paths-ignore:
- "*.md"
permissions:
contents: read
concurrency:
group: ${{ github.event.number || github.run_id }}
cancel-in-progress: true
jobs:
test:
if: ${{ !(github.event_name == 'pull_request' && github.head_ref == 'dev') }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", 3.11, 3.12, 3.13, 3.14]
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v6
- name: Setup Python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/ruff-action@v3
- name: Setup PDM by uv
run: |
uv tool install pdm --with pdm-plugin-i
pdm config check_update false
- name: Setup poetry by uv
run: |
uv tool install poetry --with poetry-plugin-version --with poetry-dynamic-versioning
poetry config virtualenvs.create false
- name: Setup ty by uv
run: |
uv tool install ty
- name: Setup just by uv
run: |
uv tool install rust-just
- name: Setup bumpvesion by uv
run: |
uv tool install bumpversion2
- name: Prepare tools
run: |
git config --global user.email "waketzheng@gmail.com"
git config --global user.name "Waket Zheng"
python -m pip install --upgrade pip pipx
python -m pipx install -e .
python -m pipx ensurepath
python -c 'from pathlib import Path;p=Path.home()/".local/bin";p.exists() or p.mkdir(parents=True)'
which pipx
which fast
ln -s `which fast` $HOME/.local/bin/fast
- name: Install requirements/Check code style and Type Hint
run: |
just check
uv pip install mypy
pdm run mypy fast_dev_cli
- name: Test with pytest
run: |
pdm run coverage run -m pytest
pdm run python -c "import os;from pathlib import Path;pp=list(Path().glob('.coverage.*'));pp and os.system('pdm run coverage combine .coverage*')"
- name: Upload Coverage
run: uvx coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
if: ${{ !(github.event_name == 'pull_request' && github.head_ref == 'dev') }}
name: Finish Coveralls
needs: test
runs-on: ubuntu-latest
steps:
- uses: astral-sh/setup-uv@v7
- name: Finished
run: uvx coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}