Testing python workflow #2
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
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.' | |
}) |