Update 01_test.yml #125
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: Build | |
on: | |
push: | |
branches: [ main, dev ] | |
schedule: | |
- cron: '0 0 * * *' # Runs at midnight UTC daily | |
jobs: | |
build: | |
runs-on: ubuntu-latest # Simplified as matrix.os isn't used | |
steps: | |
- uses: actions/checkout@v2 | |
- name: List directory contents | |
run: ls -la | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Test and generate coverage report | |
run: | | |
pip install pytest | |
pip install pytest-cov | |
pytest --cov=./ --cov-report=xml | |
# Optional: Upload coverage to Codecov if desired | |
# - name: Upload coverage to Codecov | |
# uses: codecov/codecov-action@v2 | |
# with: | |
# file: ./coverage.xml | |
# fail_ci_if_error: true | |
- name: Notify on failure | |
if: failure() # This step will only run if any previous step fails | |
run: | | |
echo "Build or tests failed. Please check the logs." |