How can I make sure that my github action workflow is working as intended?
Question:
I have a simple python script which classifies balls according to their type. The script is working as intended on my local machine.
How can I make sure that the git action workflow is running as well? I need to run the script every night. But for now I want to know if the workflow is even working.
This is my .yml file code:
name: Batch predictions
on:
schedule:
- cron: '* * * * *'
jobs:
predict:
runs-on: ubuntu-latest
steps:
- name: check out repository content
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute py script
run: python batch_predict.py
This is my github repo: https://github.com/kmeans27/ball-classification
Thank you for the help!
Answers:
-
The workflow is not running since you have a typo in your workflow file. On line 11:
- name: check out repository content
- uses: actions/checkout@v2
should be
- name: check out repository content
uses: actions/checkout@v2
You can check GitHub Actions output here
-
In ubuntu, you should use python3
instead of python
to call your Python 3 environment.
-
You can add an workflow_dispatch:
entry in on
.
on:
schedule:
- cron: '* * * * *'
workflow_dispatch:
workflow_dispatch:
event allows you to manually trigger a workflow execution.
-
If you do want to trace into execution of your Python script, consider add a few print()
in your code or use logging
standard library.
I have a simple python script which classifies balls according to their type. The script is working as intended on my local machine.
How can I make sure that the git action workflow is running as well? I need to run the script every night. But for now I want to know if the workflow is even working.
This is my .yml file code:
name: Batch predictions
on:
schedule:
- cron: '* * * * *'
jobs:
predict:
runs-on: ubuntu-latest
steps:
- name: check out repository content
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute py script
run: python batch_predict.py
This is my github repo: https://github.com/kmeans27/ball-classification
Thank you for the help!
-
The workflow is not running since you have a typo in your workflow file. On line 11:
- name: check out repository content - uses: actions/checkout@v2
should be
- name: check out repository content uses: actions/checkout@v2
You can check GitHub Actions output here
-
In ubuntu, you should use
python3
instead ofpython
to call your Python 3 environment. -
You can add an
workflow_dispatch:
entry inon
.on: schedule: - cron: '* * * * *' workflow_dispatch:
workflow_dispatch:
event allows you to manually trigger a workflow execution. -
If you do want to trace into execution of your Python script, consider add a few
print()
in your code or uselogging
standard library.