From 843a7252d576ede71a37c57266733c1f53e5e428 Mon Sep 17 00:00:00 2001 From: RoyelSteven Date: Tue, 15 Oct 2024 04:28:47 +0800 Subject: [PATCH] Update python-bench.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 requirements.txt 文件放在工作流指定的路径下,确保工作流中的每个步骤可以访问到它。 明确地用 pip install -r requirements.txt 指定安装依赖。 确保所有更改已经正确提交到 GitHub,并推送到 main 分支以触发 GitHub Actions。 --- .github/workflows/python-bench.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-bench.yml b/.github/workflows/python-bench.yml index b97ecafb..1cb3a76d 100644 --- a/.github/workflows/python-bench.yml +++ b/.github/workflows/python-bench.yml @@ -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: @@ -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'