Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
branches:
- main
- dev
- '!f/pypi_release'

jobs:
test-integration:
if: github.event.pull_request.head.ref != 'f/pypi_release'
runs-on: ubuntu-latest

steps:
Expand Down
108 changes: 65 additions & 43 deletions .github/workflows/publish_testpypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
tags:
- 'test-v*'
branches:
- 'dev'
- 'f/pypi_release'

jobs:
deploy_testpypi:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -32,53 +33,74 @@ jobs:
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
#TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
#ACTIONS_STEP_DEBUG: true
run: |
echo "TWINE_USERNAME is set to $TWINE_USERNAME"
echo "TWINE_PASSWORD is set to $TWINE_PASSWORD"
# echo "TWINE_PASSWORD first 5 chars: ${TWINE_PASSWORD:0:184}"
# echo "TWINE_PASSWORD length: ${#TWINE_PASSWORD}"
python -m build
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*

jupyter_test:
needs: deploy_testpypi
test-colab:
#needs: deploy_testpypi
runs-on: ubuntu-latest
#a Public "Colab-like" Image
container:
image: jupyter/minimal-notebook:latest
options: --user root # Run as root to avoid permission issues
permissions:
contents: write # Required for deleting the tag
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11.9
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install Colab-like environment
run: |
pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
starfish-core
pip install ipython==8.10.0 \
ipykernel==6.22.0 \
jupyter_http_over_ws>=0.0.8 \
pandas==1.5.3 \
numpy==1.23.5 \
jupyter \
pytest \
nbval
- name: Configure Colab simulation
run: |
jupyter serverextension enable --py jupyter_http_over_ws
- name: Run Colab-style tests
run: |
pytest --nbval \
--nbval-kernel-name=python3 \
--nbval-cell-timeout=120 \
--nbval-sanitize-with ./tests/sanitize.cfg \
tests/data_factory/factory/test_resume_index.ipynb
- uses: actions/checkout@v3
with:
sparse-checkout: |
tests/*
sparse-checkout-cone-mode: false
- name: Update system packages
run: |
apt-get update
apt-get install -y libssl3 # Removed sudo since we're running as root
- name: Print Python and Jupyter versions
run: |
python --version
pip list | grep -E 'jupyter|ipykernel|nbconvert|notebook'
# Authenticate to GCP
# - name: Authenticate to GCP
# uses: google-github-actions/auth@v1
# with:
# credentials_json: ${{ secrets.GCP_SA_KEY }}

# Add tag deletion step
- name: Delete triggering tag after successful test
if: success() && startsWith(github.ref, 'refs/tags/test-v')
run: |
gh api -X DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/${GITHUB_REF#refs/tags/}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # Configure Docker to use GCR credentials
# - name: Configure Docker for GCR
# uses: google-github-actions/docker-auth@v1

# # Now you can pull the image
# - name: Use Colab base image
# run: docker pull gcr.io/colab-images/base:latest

# --no-prompt --no-input \ suppress the output
- name: Run Colab-style tests
run: |
if ! jupyter nbconvert --execute --to notebook --inplace \
--ExecutePreprocessor.kernel_name=python3 \
--ExecutePreprocessor.timeout=120 \
--no-prompt --no-input \
--stdout \
tests/data_factory/factory/test_resume_index_1.ipynb; then
echo "::error::Notebook execution failed"

fi
echo "Notebook executed successfully. Summary:" && \
jupyter nbconvert --to markdown --stdout \
tests/data_factory/factory/test_resume_index_1.ipynb | \
grep -E '^#|^##' || true

# Add tag deletion step
- name: Delete triggering tag after successful test
if: startsWith(github.ref, 'refs/tags/test-v')
run: |
gh api -X DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/${GITHUB_REF#refs/tags/}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading