Skip to content

fix bench cmd

fix bench cmd #320

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
jobs:
Testing:
runs-on: ${{ matrix.os }}
env:
UV_CACHE_DIR: "/tmp/.uv-cache"
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install tzfpy and test
shell: bash
run: |
uv run ruff check .
uv run pytest | tee benchmark_result.txt
- name: Setup benchmark file name
id: gen-benchmark-file-name
shell: bash
run: |
echo "filename=tzfpy_benchmark_py_${{ matrix.python-version }}_${{ matrix.os }}.md" >> $GITHUB_OUTPUT
- name: Report
shell: bash
run: |
set +e
echo "## Python ${{ matrix.python-version }} with ${{ matrix.os }}" >> ${{ steps.gen-benchmark-file-name.outputs.filename }}
echo '```' >> ${{ steps.gen-benchmark-file-name.outputs.filename }}
cat benchmark_result.txt >> ${{ steps.gen-benchmark-file-name.outputs.filename }}
echo '```' >> ${{ steps.gen-benchmark-file-name.outputs.filename }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "benchmark_result_as_md_${{ matrix.python-version }}_${{ matrix.os }}"
path: ${{ steps.gen-benchmark-file-name.outputs.filename }}
- name: Minimize uv cache
run: uv cache prune --ci
Report:
needs: [Testing]
runs-on: ubuntu-latest
steps:
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
pattern: "benchmark_result_as_md*"
- run: find . -name "*.md" -exec cat {} \; > $GITHUB_STEP_SUMMARY