From 02290457a96a3c2b48a3b76a771eaacb9c6cd0ca Mon Sep 17 00:00:00 2001 From: vsyrgkanis Date: Fri, 28 Jun 2024 05:44:09 -0700 Subject: [PATCH] Update python-package-conda.yml --- .github/workflows/python-package-conda.yml | 45 ++++++++++------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 1c889c4e..1f9de464 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -1,37 +1,34 @@ -name: Python Package using Conda +name: Run Jupyter Notebooks on: - schedule: - - cron: '0 */12 1 * *' push: - workflow_dispatch: + branches: + - main + schedule: + - cron: '0 0 * * 0' # Runs once a week on Sunday at midnight jobs: - build-linux: + run-notebooks: runs-on: ubuntu-latest - strategy: - max-parallel: 5 steps: - - uses: actions/checkout@v4 - - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.8' # Adjust this to your preferred Python version + - name: Install dependencies run: | - pip install -r requirements.txt - - name: Run Notebook + python -m pip install --upgrade pip + pip install jupyter nbconvert + + - name: Convert Jupyter notebooks to Python scripts run: | - cd PM1 - jupyter nbconvert --to script python-linear-model-overfitting.ipynb - python python-linear-model-overfitting.py - - name: Lint with flake8 + find . -name "*.ipynb" -exec jupyter nbconvert --to script {} \; + + - name: Run Python scripts run: | - pip install -y flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - + find . -name "*.py" -exec python {} \;