-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from arunsathiya/new/python
Python implementations on the side; yet to complete the days that I have so far
- Loading branch information
Showing
48 changed files
with
7,304 additions
and
12 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
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,59 @@ | ||
name: Python Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
python-diff: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
- id: set-matrix | ||
run: | | ||
changed_dirs=$(git diff --name-only origin/${{ github.base_ref }} | grep '.py$' | xargs -I {} dirname {} | uniq | awk '{print "\"" $0 "\""}' | jq -R -s -c 'split("\n")[:-1]') | ||
echo "Changed directories: $changed_dirs" | ||
echo "matrix=$changed_dirs" >> $GITHUB_OUTPUT | ||
python-test: | ||
needs: python-diff | ||
runs-on: ubuntu-latest | ||
if: needs.python-diff.outputs.matrix != '[]' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dir: ${{fromJson(needs.python-diff.outputs.matrix)}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Run Python tests in changed directories | ||
run: | | ||
for dir in "${{ matrix.dir }}"; do | ||
if [ -d "$dir" ]; then | ||
echo "Running Python tests in $dir" | ||
(cd "$dir" && python -m unittest discover) | ||
else | ||
echo "No Python files in $dir" | ||
fi | ||
done | ||
python-test-main: | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Run Python tests | ||
run: python -m unittest discover |
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 |
---|---|---|
|
@@ -23,3 +23,8 @@ go.work | |
# Misc | ||
.DS_Store | ||
.aider* | ||
|
||
# Python | ||
*.pyc | ||
__pycache__/ | ||
.pytest_cache/ |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.