✨ Adding automatic testing and improving existing workflows#54
✨ Adding automatic testing and improving existing workflows#54IronMax03 wants to merge 37 commits intoAlgorithmsAcademy:mainfrom
Conversation
Enhancement/improve workflow
|
|
||
| const algoName = match[1].trim(); | ||
| const issueNumber = context.issue.number; | ||
| const newTitle = `✨ Implement ${algoName}`; | ||
|
|
There was a problem hiding this comment.
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}`;
```| issue_number: issueNumber, | ||
| title: newTitle | ||
| }); | ||
|
|
There was a problem hiding this comment.
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.`
});There was a problem hiding this comment.
why did you remove title: newTitle?
There was a problem hiding this comment.
body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names. thats nice.
There was a problem hiding this comment.
why did you remove
title: newTitle?
Did not remove it I suggested adding a comment
| numpy | ||
| ruff | ||
| rich | ||
| pytest |
There was a problem hiding this comment.
Delete this file, I do no like this
There was a problem hiding this comment.
This approach is more scalable.
There was a problem hiding this comment.
No this is absolutely not scalable, uv does that for us
.github/workflows/code-tester.yaml
Outdated
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' |
There was a problem hiding this comment.
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
There was a problem hiding this comment.
By default the action /setup-python@v4 use ".python-version", if ".python-version" cant be found then "python-version: '3.12'" is used. But if you want to remove it simply remove "with" as below.
- name: "Set up Python"
uses: actions/setup-python@v5There was a problem hiding this comment.
Yes so let's remove it like you suggested
.github/workflows/code-tester.yaml
Outdated
|
|
||
| steps: | ||
| - name: Download Repo In Docker | ||
| uses: actions/checkout@v3 |
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
There was a problem hiding this comment.
- 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
There was a problem hiding this comment.
uv is already installed by:
- name: Install dependencies
run: pip install -r requirements.txtThere was a problem hiding this comment.
Yes but requirements.txt is a terrible design choice
There was a problem hiding this comment.
Is this line complementary or does it replace the code below?
uses: actions/checkout@v3
with:
fetch-depth: 0
.github/workflows/code-tester.yaml
Outdated
| - name: Install dependencies | ||
| run: pip install -r requirements.txt |
There was a problem hiding this comment.
No, pytest as to be installed in order to run testcases.
There was a problem hiding this comment.
pytest is installed inside uv so we can delete this
.github/workflows/code-tester.yaml
Outdated
| run: pip install -r requirements.txt | ||
|
|
||
| - name: Run tests | ||
| run: pytest tests --collect-only |
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
There was a problem hiding this comment.
Yes but requirements.txt is a terrible design choice
.github/workflows/code-tester.yaml
Outdated
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' |
There was a problem hiding this comment.
Yes so let's remove it like you suggested
.github/workflows/code-tester.yaml
Outdated
| - name: Install dependencies | ||
| run: pip install -r requirements.txt |
There was a problem hiding this comment.
pytest is installed inside uv so we can delete this
| issue_number: issueNumber, | ||
| title: newTitle | ||
| }); | ||
|
|
There was a problem hiding this comment.
why did you remove
title: newTitle?
Did not remove it I suggested adding a comment
No description provided.