diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml new file mode 100644 index 0000000..68f8e10 --- /dev/null +++ b/.github/workflows/debug.yml @@ -0,0 +1,11 @@ + +name: Debug Manual Run + +on: + workflow_dispatch: + +jobs: + debug: + runs-on: ubuntu-latest + steps: + - run: echo "Workflow runs" diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..0bb3ca1 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -34,6 +34,7 @@ on: env: python-version: "3.13" + NOTIFY_USER: santosi0 jobs: # Job #1: Run Python unit tests @@ -68,12 +69,25 @@ jobs: # on the test results. notifications: needs: python-unit-tests - runs-on: ubuntu-latest + runs-on: ubuntu-latest +# Only run this job if the test job failed + if: needs.python-unit-tests.result == 'failure' + steps: - - name: Notify on test results - run: | - if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" - else - echo "failure notifications go here" - fi + - name: Create GitHub issue on test failure + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: "❌ Python Unit Tests Failed", + body: `@${process.env.NOTIFY_USER} + The Python unit tests failed. + + • Workflow: ${context.workflow} + • Branch: ${context.ref} + • Commit: ${context.sha} + Please check the GitHub Actions logs for details.` + ) + '' diff --git a/Makefile b/Makefile index 7bebd1b..539590c 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,10 @@ export ifeq ($(OS),Windows_NT) PYTHON := python.exe - ACTIVATE_VENV := venv\Scripts\activate + ACTIVATE_VENV := venv/Scripts/activate else PYTHON := python3.13 - ACTIVATE_VENV := source venv/bin/activate + ACTIVATE_VENV := source venv/Scripts/activate endif PIP := $(PYTHON) -m pip