-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use codspeed for continues benchmark (#54)
- Loading branch information
1 parent
148d444
commit 63c6a45
Showing
8 changed files
with
168 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "monthly" | ||
groups: | ||
# Specify a name for the group, which will be used in pull request titles | ||
# and branch names | ||
dependencies: | ||
# Define patterns to include dependencies in the group (based on | ||
# dependency name) | ||
patterns: | ||
- "*" # A wildcard that matches all dependencies in the package | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "monthly" | ||
groups: | ||
# Specify a name for the group, which will be used in pull request titles | ||
# and branch names | ||
dependencies: | ||
# Define patterns to include dependencies in the group (based on | ||
# dependency name) | ||
patterns: | ||
- "*" # A wildcard that matches all dependencies in the package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Bench | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
benchmark: | ||
name: Continuous Benchmarking with CodSpeed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Collect Workflow Telemetry | ||
uses: runforesight/workflow-telemetry-action@v2 | ||
with: | ||
comment_on_pr: false | ||
- uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Run benchmarks | ||
uses: CodSpeedHQ/action@v3 | ||
with: | ||
run: | | ||
uv run pytest --codspeed --benchmark-warmup=off --benchmark-warmup-iterations=10 --benchmark-min-rounds=2 -v tests/test_perf.py | ||
- name: Minimize uv cache | ||
run: uv cache prune --ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,41 +10,6 @@ on: | |
branches: ["main"] | ||
|
||
jobs: | ||
coverage-perf: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- run: make bench | ||
|
||
- name: Upload coverage reports to Codecov | ||
run: | | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
./codecov -t ${{ secrets.CODECOV_TOKEN }} | ||
- name: Continuous Benchmark | ||
uses: benchmark-action/[email protected] | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
name: cyeva Benchmark | ||
tool: "pytest" | ||
output-file-path: output.json | ||
github-token: ${{ secrets.OPS_ACTIONS_CI_TOKEN }} | ||
gh-repository: "github.com/caiyunapp/cyeva" | ||
auto-push: true | ||
alert-threshold: "150%" | ||
comment-on-alert: true | ||
fail-on-alert: false | ||
benchmark-data-dir-path: "performance/" | ||
alert-comment-cc-users: "@clarmy" | ||
|
||
Test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -64,3 +29,9 @@ jobs: | |
with: | ||
enable-cache: true | ||
- run: make all | ||
- name: Upload coverage reports to Codecov | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
./codecov -t ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,4 +131,6 @@ dmypy.json | |
.DS_Store | ||
.vscode | ||
*.ipynb | ||
_build | ||
_build | ||
|
||
output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.