What I have so far is this code:
name: test run
on:
push:
branches:
- V2.0
jobs:
build:
runs-on: [windows-2019]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyautogui
pip install opencv-python
pip install numpy
pip install pynput
- name: Test
run: python Cristishor201/[email protected]/src/pytest.py
And I want to run pytest.py
script which is inside my_repo repository, branch V2.0, and in folder src.
Does anyone have an idea how to do this ?
UPDATE 1:
I found this article when he put github.ref
environment variable using if
statement. The problem with this solution is that it skip the code, and I already filtered the branch in the trigger block.
name: my workflow
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Execute tests
run: exit 0
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- name: Deploy app
run: exit 0
I tried using env:
instead if:
but it didn't work.
python .\src\pytest.py
(assuming the source folder is in your repo root).