Skip to content

Commit

Permalink
Update python-bench.yml
Browse files Browse the repository at this point in the history
将 requirements.txt 文件放在工作流指定的路径下,确保工作流中的每个步骤可以访问到它。
明确地用 pip install -r requirements.txt 指定安装依赖。
确保所有更改已经正确提交到 GitHub,并推送到 main 分支以触发 GitHub Actions。
  • Loading branch information
RoyelSteven-Ai authored Oct 14, 2024
1 parent 41bd1ac commit 843a725
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/python-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:
- main

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

jobs:
Expand All @@ -32,30 +30,26 @@ jobs:
working-directory: ./bindings/python
run: |
pip install -U pip
pip install .[dev]
pip install -r requirements.txt
- name: Run tests
working-directory: ./bindings/python
run: |
cargo test
pytest --benchmark-json output.json benches/
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'pytest'
# Where the output from the benchmark tool is stored
output-file-path: ./bindings/python/output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
comment-on-alert: true
# Mention @rhysd in the commit comment
alert-comment-cc-users: '@Narsil'

0 comments on commit 843a725

Please sign in to comment.