Skip to content

Commit

Permalink
update pep8 check
Browse files Browse the repository at this point in the history
change pep8 workflow to point at the centralized version
  • Loading branch information
ttdu authored Jan 3, 2024
1 parent 0e2f188 commit 6b0fdac
Showing 1 changed file with 2 additions and 51 deletions.
53 changes: 2 additions & 51 deletions .github/workflows/pep8_nb_style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,5 @@ on:
- '*.yml'

jobs:
gather-notebooks:
# below logic will only allow workflow to trigger under specific conditions
if: github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
## routine to gather only the changed notebook files and supply them to the matrix
- name: changed-files
id: get-changed-files
uses: tj-actions/changed-files@v35
with:
separator: ","
files: |
**/*.ipynb
## convert the list of files to an array and push them into the matrix as a json object
- name: set-matrix
id: set-matrix
run: |
IFS=',' read -r -a array <<< "${{steps.get-changed-files.outputs.all_changed_files}}"
echo "{$array}"
echo "matrix=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${array[@]}")" >> $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@v3
- name: Set up Python 3.8.12
uses: actions/setup-python@v4 ## needed for caching
with:
python-version: 3.8.12
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: Run PEP8 style check
run: |
python .github/helpers/pep8_nb_style_checker.py -f ${{ matrix.notebooks }}
Notebook_PEP8_Check:
uses: spacetelescope/notebook-ci-actions/.github/workflows/notebook_pep8check.yml@main

0 comments on commit 6b0fdac

Please sign in to comment.