Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Scheduled Weekly Deprecation Warning Check #56 #57

Draft
wants to merge 1 commit into
base: v4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/ci_deprecation_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Scheduled Notebook Execution
on:
workflow_call:
inputs:
python-version:
required: true
type: string
secrets:
CASJOBS_USERID:
description: 'CASJOBS user ID'
required: false
CASJOBS_PW:
description: 'CASJOBS password'
required: false

#permissions: write-all
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
tests:
needs: gather-notebooks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
notebooks: ${{ fromJson(needs.gather-notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
#- run: |
# pip install -r ${${{ matrix.notebooks }}%/*}/requirements.txt
- uses: actions/checkout@v4

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
export PYDEVD_DISABLE_FILE_VALIDATION=1
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
#python -m pip install --upgrade pip
#pip install wheel
echo "Path to req's: $(dirname ${{ matrix.notebooks }})/requirements.txt"
ls $(dirname ${{ matrix.notebooks }})
echo ---
if [ -f $(dirname "${{ matrix.notebooks }}")/pre-install.sh ]; then
chmod +x $(dirname "${{ matrix.notebooks }}")/pre-install.sh
./$(dirname "${{ matrix.notebooks }}")/pre-install.sh
fi
if [ -f $(dirname "${{ matrix.notebooks }}")/pre-requirements.sh ]; then
chmod +x $(dirname "${{ matrix.notebooks }}")/pre-requirements.sh
./$(dirname "${{ matrix.notebooks }}")/pre-requirements.sh
fi
if [ -f $(dirname "${{ matrix.notebooks }}")/pre-requirements.txt ]; then
pip install -r $(dirname "${{ matrix.notebooks }}")/pre-requirements.txt
fi
if [ -f pre-requirements.txt ]; then
pip install -r pre-requirements.txt
fi
pip install -r $(dirname ${{ matrix.notebooks }})/requirements.txt
pip install pytest
pip install nbval
pip install nbconvert
if [ "${GITHUB_REPOSITORY}" == "spacetelescope/hst_notebooks" ]; then
source /usr/share/miniconda/etc/profile.d/conda.sh
conda create --yes -n hstcal -c conda-forge hstcal
fi

- name: Execute notebooks
run: |
if [ "${GITHUB_REPOSITORY}" == "spacetelescope/hst_notebooks" ]; then
source /usr/share/miniconda/etc/profile.d/conda.sh
conda init
conda activate hstcal
fi
jupyter nbconvert --template classic --to html --execute "${{ matrix.notebooks }}"
- name: Validate notebooks
run: |
pytest --nbval --nbval-cell-timeout 4000 "${{ matrix.notebooks }}" -W error::DeprecationWarning
17 changes: 10 additions & 7 deletions .github/workflows/ci_scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Scheduled Notebook Execution
on:
workflow_call:
inputs:
inputs:
python-version:
required: true
type: string
Expand All @@ -12,8 +12,8 @@ on:
CASJOBS_PW:
description: 'CASJOBS password'
required: false
#permissions: write-all

#permissions: write-all
jobs:
gather-notebooks:
runs-on: ubuntu-latest
Expand All @@ -32,15 +32,15 @@ jobs:
notebooks: ${{ fromJson(needs.gather-notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
#- run: |
#- run: |
# pip install -r ${${{ matrix.notebooks }}%/*}/requirements.txt
- uses: actions/checkout@v4

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
export PYDEVD_DISABLE_FILE_VALIDATION=1
Expand Down Expand Up @@ -70,9 +70,9 @@ jobs:
pip install nbconvert
if [ "${GITHUB_REPOSITORY}" == "spacetelescope/hst_notebooks" ]; then
source /usr/share/miniconda/etc/profile.d/conda.sh
conda create --yes -n hstcal -c conda-forge hstcal
conda create --yes -n hstcal -c conda-forge hstcal
fi

- name: Execute notebooks
run: |
if [ "${GITHUB_REPOSITORY}" == "spacetelescope/hst_notebooks" ]; then
Expand All @@ -81,3 +81,6 @@ jobs:
conda activate hstcal
fi
jupyter nbconvert --template classic --to html --execute "${{ matrix.notebooks }}"
- name: Validate notebooks
run: |
pytest --nbval --nbval-cell-timeout 4000 "${{ matrix.notebooks }}"