Update python-package-conda.yml #13
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 Jupyter Notebooks | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * 0' # Runs once a week on Sunday at midnight | |
jobs: | |
run-notebooks: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # Adjust this to your preferred Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install jupyter nbconvert flake8 | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
shell: bash | |
- name: Convert Jupyter notebooks to Python scripts | |
run: | | |
find . -name "*.ipynb" -exec jupyter nbconvert --to script {} \; | |
shell: bash | |
- name: Run Flake8 linting | |
run: | | |
find . -name "*.py" -exec flake8 {} \; | |
shell: bash | |
- name: Run Python scripts | |
run: | | |
find . -name "*.py" -exec python {} \; | |
shell: bash |