-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Adding automatic testing and improving existing workflows #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
23db052
52ee4ac
358b8bc
af22686
51494c6
7ebd7e7
61e2353
ea40cd5
b8d83fc
ce53978
59797a3
6efdeab
031bb0f
7cbb52f
4280607
4fd1e16
2cf1017
922fe9c
a5a3396
8db5250
faf4a2d
1d3037c
ed6785f
d9f4f40
b365c56
c74ebe4
66e1a21
f74b2a4
9dabbc9
f90fee7
3865d13
d2441b4
8031209
b942fd7
7c742a2
3496ceb
f4a5ece
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Code Tester | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| checks: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
|
|
||
| - name: Download Repo In Docker | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: uv.lock | ||
|
|
||
| - name: Install the project | ||
| run: uv sync --locked --all-extras --dev | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| pip install pytest | ||
| pytest tests --quiet --collect-only | ||
|
|
||
| - name: Style Check | ||
| run: ruff check | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: Issue Automatic Renaming | ||
|
|
||
| on: | ||
| issues: | ||
| types: [opened, edited] | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| rename-issue: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Rename for New Algo Issues | ||
| uses: actions/github-script@v7 | ||
| if: contains(github.event.issue.body, '### Algo_Name') | ||
| with: | ||
| script: | | ||
| const issueBody = context.payload.issue.body; | ||
| console.log("Issue Body:\n", issueBody); | ||
|
|
||
| const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody); | ||
| if (!match) { | ||
| console.log("🚫 Could not find algo name in Markdown."); | ||
| return; | ||
| } | ||
|
|
||
| const algoName = match[1].trim(); | ||
| const issueNumber = context.issue.number; | ||
| const formattedAlgoName = algoName | ||
| .toLowerCase() | ||
| .replace(/\s+/g, '_') // Replace spaces with underscores | ||
| .replace(/[^\w_]/g, '') // Remove special characters | ||
| .replace(/_+/g, '_'); // Replace multiple underscores with single | ||
|
|
||
| const newTitle = `✨ Implement ${formattedAlgoName}`; | ||
|
|
||
| console.log(`🔧 Updating issue title to: ${newTitle}`); | ||
|
|
||
| await github.rest.issues.update({ | ||
| ...context.repo, | ||
| issue_number: issueNumber, | ||
| title: newTitle, | ||
| body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names.` | ||
| }); | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. await github.rest.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names.`
});
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you remove
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - name: Rename for Bug Report Issues | ||
| uses: actions/github-script@v7 | ||
| if: contains(github.event.issue.body, '### Type') | ||
| with: | ||
| script: | | ||
| const body = context.payload.issue.body; | ||
| console.log("Issue Body:\n", body); | ||
|
|
||
| const typeMatch = /### Type\s+(.+?)\s*(###|$)/s.exec(body); | ||
| const Type = typeMatch ? typeMatch[1].trim() : null; | ||
|
|
||
| if (!Type) { | ||
| console.log("🚫 Could not find Type in Markdown."); | ||
| return; | ||
| } | ||
|
|
||
| const typeMap = { | ||
| "🧮 Algorithm Implementation": "🧮", | ||
| "🛠 CI/Tooling Issue": "🛠", | ||
| "📘 Algorithm Documentation": "📘", | ||
| "🖋 General Documentation": "🖋", | ||
| "🧪 Test Failure or Adding Testcase": "🧪", | ||
| "❓ Other / Not Sure": "❓", | ||
| }; | ||
| const typeIcon = typeMap[Type] || "❓"; | ||
|
|
||
| const rawTitle = context.payload.issue.title; | ||
|
|
||
| const issueNumber = context.issue.number; | ||
| const updatedTitle = `⚠️ - ${typeIcon} [Bug]: ${rawTitle}`; | ||
|
|
||
| console.log(`🔧 Updating issue title to: ${updatedTitle}`); | ||
|
|
||
| await github.rest.issues.update({ | ||
| ...context.repo, | ||
| issue_number: issueNumber, | ||
| title: updatedTitle | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| numpy | ||
| ruff | ||
| rich | ||
| pytest | ||
|
Comment on lines
+1
to
+4
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete this file, I do no like this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach is more scalable.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No this is absolutely not scalable, uv does that for us |
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv is already installed by:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but requirements.txt is a terrible design choice
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line complementary or does it replace the code below?