Skip to content

Commit b4357e0

Browse files
authored
chore(ci): added missing hrefs in changelogs & added specs to benchmarks (#37)
* chore(ci): adding missing hrefs in changelogs and added specs to benchmarks * chore(ci): Added missing python package & cleaned PR template
1 parent 7c3a453 commit b4357e0

File tree

4 files changed

+84
-26
lines changed

4 files changed

+84
-26
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
---
22
name: Pull Request
33
about: Propose a change to the project
4-
title: 'feat(scope): describe your change'
5-
labels: ''
6-
assignees: ''
7-
4+
title: "feat(scope): describe your change"
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Description**
1110

12-
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
11+
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
1312

1413
**Fixes** (issue)
1514

1615
**Type of change**
1716

18-
Please update the title of your PR to match the type of change. The title will be used for the commit message and the changelog.
19-
20-
The `(scope)` is optional and refers to the part of the codebase you're changing (e.g., `feat(search)`, `fix(ci)`).
21-
22-
- [ ] `fix`: A bug fix
23-
- [ ] `feat`: A new feature
24-
- [ ] `feat!`: A breaking change
25-
- [ ] `docs`: Documentation only changes
26-
- [ ] `chore`: Changes to the build process or auxiliary tools
27-
- [ ] `refactor`: A code change that neither fixes a bug nor adds a feature
28-
- [ ] `perf`: A code change that improves performance
29-
- [ ] `test`: Adding missing tests or correcting existing tests
30-
- [ ] `style`: Changes that do not affect the meaning of the code
31-
- [ ] `ci`: Changes to our CI configuration files and scripts
32-
- [ ] `revert`: Reverts a previous commit
17+
<!-- Please update the title of your PR to match the type of change. The title will be used for the commit message and the changelog. -->
18+
<!---->
19+
<!-- The `(scope)` is optional and refers to the part of the codebase you're changing (e.g., `feat(search)`, `fix(ci)`). -->
20+
21+
<!-- - [ ] `fix`: A bug fix -->
22+
<!-- - [ ] `feat`: A new feature -->
23+
<!-- - [ ] `feat!`: A breaking change -->
24+
<!-- - [ ] `docs`: Documentation only changes -->
25+
<!-- - [ ] `chore`: Changes to the build process or auxiliary tools -->
26+
<!-- - [ ] `refactor`: A code change that neither fixes a bug nor adds a feature -->
27+
<!-- - [ ] `perf`: A code change that improves performance -->
28+
<!-- - [ ] `test`: Adding missing tests or correcting existing tests -->
29+
<!-- - [ ] `style`: Changes that do not affect the meaning of the code -->
30+
<!-- - [ ] `ci`: Changes to our CI configuration files and scripts -->
31+
<!-- - [ ] `revert`: Reverts a previous commit -->
3332

3433
**How Has This Been Tested?**
3534

36-
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
35+
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. -->
3736

3837
- [ ] Test A
3938
- [ ] Test B

.github/workflows/CI.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
pip install uv
6262
uv venv
6363
source .venv/bin/activate
64-
uv pip install simstring-fast pandas maturin tabulate
64+
uv pip install simstring-fast pandas maturin tabulate psutil
6565
rm -rf target/wheels
6666
maturin build --release
6767
uv pip install target/wheels/*.whl
@@ -393,3 +393,44 @@ jobs:
393393
run: cargo publish
394394
env:
395395
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
396+
397+
release:
398+
name: Create GitHub Release
399+
needs: [publish_to_pypi, publish]
400+
runs-on: ubuntu-latest
401+
if: startsWith(github.ref, 'refs/tags/v')
402+
steps:
403+
- name: Checkout code
404+
uses: actions/checkout@v4
405+
with:
406+
fetch-depth: 0 # get all tags
407+
408+
- name: Get release notes
409+
id: get_release_notes
410+
run: |
411+
# Get the latest tag
412+
latest_tag=$(git describe --tags --abbrev=0)
413+
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
414+
415+
# Extract release notes from CHANGELOG.md
416+
# This script extracts the content between the latest tag and the previous tag.
417+
notes=$(awk -v tag="## [${latest_tag##v}]" '
418+
BEGIN { p = 0 }
419+
$0 ~ tag { p = 1; next }
420+
p && /^## / { exit }
421+
p { print }
422+
' CHANGELOG.md)
423+
echo "notes<<EOF" >> $GITHUB_OUTPUT
424+
echo "$notes" >> $GITHUB_OUTPUT
425+
echo "EOF" >> $GITHUB_OUTPUT
426+
427+
- name: Create Release
428+
uses: softprops/action-gh-release@v1
429+
with:
430+
tag_name: ${{ env.latest_tag }}
431+
name: "Release ${{ env.latest_tag }}"
432+
body: ${{ steps.get_release_notes.outputs.notes }}
433+
draft: false
434+
prerelease: contains(github.ref, 'alpha') || contains(github.ref, 'beta')
435+
env:
436+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

benches/compare_benches.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import json
2+
import platform
23
import sys
34
from pathlib import Path
45

56
import pandas as pd
7+
import psutil
8+
9+
10+
def get_system_specs():
11+
return {
12+
"OS": f"{platform.system()} {platform.release()}",
13+
"Architecture": platform.machine(),
14+
"CPU Model": platform.processor(),
15+
"CPU Cores": f"{psutil.cpu_count(logical=True)} logical, {psutil.cpu_count(logical=False)} physical",
16+
"Memory": f"{psutil.virtual_memory().total / (1024**3):.2f} GB",
17+
}
618

719

820
def compare_benchmarks():
@@ -36,6 +48,13 @@ def compare_benchmarks():
3648
"This file is automatically generated by the CI. Do not edit manually.\n\n"
3749
)
3850

51+
# Add system specs
52+
specs = get_system_specs()
53+
f.write("## System Specifications\n\n")
54+
for key, value in specs.items():
55+
f.write(f"- **{key}:** {value}\n")
56+
f.write("\n")
57+
3958
for benchmark, group in df.groupby("benchmark"):
4059
f.write(f"### {str(benchmark).capitalize()} Benchmark\n")
4160

cliff.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body = """
1919
{% for group, commits in commits | group_by(attribute="group") %}
2020
### {{ group | upper_first }}
2121
{% for commit in commits %}
22-
- {% if commit.scope %}(**{{ commit.scope }}**) {% endif %}{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}])
22+
- {% if commit.scope %}(**{{ commit.scope }}**) {% endif %}{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/PyDataBlog/simstring_rs/commit/{{ commit.id }}))
2323
{% endfor %}
2424
{% endfor %}
2525
@@ -65,7 +65,6 @@ tag_pattern = "v[0-9].*"
6565
skip_tags = "v0.1.0-beta.1"
6666
# regex for ignoring tags
6767
ignore_tags = ""
68-
link_parsers = [
69-
{ pattern = "\\b[a-f0-9]{7}\\b", href = "https://github.com/PyDataBlog/simstring_rs/commit/$0" },
70-
{ pattern = "#(\\d+)", href = "https://github.com/PyDataBlog/simstring_rs/issues/$1" },
68+
commit_preprocessors = [
69+
{ pattern = "\\(#(\\d+)\\)", replace = "[#$1](https://github.com/PyDataBlog/simstring_rs/issues/$1)" },
7170
]

0 commit comments

Comments
 (0)