Run Python Mock-up Data Script #132
This file contains hidden or 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 Mock-up Data Script | |
| on: | |
| schedule: | |
| # Run every weekday at 7:00 AM UTC | |
| - cron: "0 7 * * 1-5" | |
| # Run the script from GitHub interface | |
| workflow_dispatch: | |
| jobs: | |
| execute-python-scripts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Set up Python environment | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| # Install tofupilot package | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| # Set TOFUPILOT_API_KEY and run all Python files in corresponding folder | |
| - name: Run Battery-Testing Script | |
| env: | |
| TOFUPILOT_API_KEY: ${{ secrets.GET_STARTED_BATTERY_API_KEY }} | |
| run: | | |
| cd welcome_aboard/battery_testing | |
| for i in {1..10}; do | |
| echo "Execution $i" | |
| python main.py | |
| done |