From a4699d09ee571ae082d9ee3d4395235a99505e22 Mon Sep 17 00:00:00 2001 From: ViNN280801 Date: Thu, 7 Nov 2024 15:52:28 +0300 Subject: [PATCH] Added python testing workflow Signed-off-by: ViNN280801 --- ...2.04.yaml => cpptesting_ubuntu.22.04.yaml} | 0 .github/workflows/pytesting_ubuntu.yaml | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+) rename .github/workflows/{cpptesting_ubuntu22.04.yaml => cpptesting_ubuntu.22.04.yaml} (100%) create mode 100644 .github/workflows/pytesting_ubuntu.yaml diff --git a/.github/workflows/cpptesting_ubuntu22.04.yaml b/.github/workflows/cpptesting_ubuntu.22.04.yaml similarity index 100% rename from .github/workflows/cpptesting_ubuntu22.04.yaml rename to .github/workflows/cpptesting_ubuntu.22.04.yaml diff --git a/.github/workflows/pytesting_ubuntu.yaml b/.github/workflows/pytesting_ubuntu.yaml new file mode 100644 index 0000000..4a354cd --- /dev/null +++ b/.github/workflows/pytesting_ubuntu.yaml @@ -0,0 +1,47 @@ +name: Run Python Tests + +on: + push: + branches-ignore: main + paths: + - "**/*.py" + pull_request: + branches: main + paths: + - "**/*.py" + workflow_dispatch: + +jobs: + run_python_tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Python tests + run: | + python ui/run_tests.py + + - name: Notify author on success + if: success() && github.event_name == 'pull_request' + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '@ViNN280801 All Python tests have passed successfully. Please review the changes and proceed with the next steps if everything looks good.' + })