Skip to content

Commit

Permalink
Merge pull request #30 from spacetelescope/dulude-patch-2
Browse files Browse the repository at this point in the history
Create all_notebooks_pep8check.yml
  • Loading branch information
dulude authored Feb 7, 2024
2 parents 3f29679 + dbebc3b commit e5cdd21
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/all_notebooks_pep8check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## This workflow performs PEP8 style checks on the python code in notebook code cells.
## This workflow scans all notebooks in a repository, not just those modified in a pull request.
name: PEP8 Notebook Style Check Execution

on:
workflow_call:
inputs:
python-version:
required: true
type: string
jobs:
gather-notebooks:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(find notebooks -name "*.ipynb" | jq -cnR '[inputs | select(length>0)]')" >> $GITHUB_OUTPUT
notebook-style-checks:
needs: gather-notebooks
environment: ci_env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
notebooks: ${{ fromJson(needs.gather-notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5 ## needed for caching
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
pip install flake8
pip install numpy
pip install pytz
- name: Check-out notebook-ci-actions repository
uses: actions/checkout@v4
with:
repository: spacetelescope/notebook-ci-actions
path: temp_pep8checker
ref: v3
- name: Run PEP8 style check
run: |
python temp_pep8checker/.github/helpers/pep8_nb_style_checker.py ${{ matrix.notebooks }}

0 comments on commit e5cdd21

Please sign in to comment.