-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8012cf5
commit 0229045
Showing
1 changed file
with
21 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {} \; |