Skip to content

Commit

Permalink
update post release workflow to have jobs for post test pypi deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham3121 committed Apr 1, 2024
1 parent 6657391 commit 581f571
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
75 changes: 74 additions & 1 deletion .github/workflows/cd-post-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ on:
required: true
type: string

release_platform:
description: "Release Platform"
required: true
type: string
default: "REAL_PYPI"

jobs:
notebook-test-hagrid:
if: github.event.inputs.release_platform == 'REAL_PYPI'
strategy:
max-parallel: 99
matrix:
Expand Down Expand Up @@ -155,13 +162,19 @@ jobs:
- name: Install Syft
run: |
pip install syft==${{ inputs.syft_version }}
if [[ "${{ inputs.release_platform }}" == "REAL_PYPI" ]]; then
pip install syft==${{ inputs.syft_version }}
fi
if [[ "${{ inputs.release_platform }}" == "TEST_PYPI" ]]; then
pip install -i https://test.pypi.org/simple/ syft==${{ inputs.syft_version }}
fi
- name: Check Syft version
run: |
python -c "import syft; print(syft.__version__)"
notebook-test-k8s-k3d:
if: github.event.inputs.release_platform == 'REAL_PYPI'
strategy:
max-parallel: 99
matrix:
Expand Down Expand Up @@ -216,3 +229,63 @@ jobs:
SYFT_VERSION: ${{ inputs.syft_version }}
run: |
tox -e syft.test.helm
# This job is used to test the syft unit tests on Test PyPi
syft-unit-tests:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.12", "3.11", "3.10"]
runs-on: ${{ matrix.os }}
steps:
- name: System Architecture
run: |
echo "System Architecture: $(uname -m)"
echo "System Version: $(uname -a)"
- uses: actions/checkout@v4

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

with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
python -m pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install Syft
env:
SYFT_VERSION: ${{ inputs.syft_version }}
run: |
if [[ "${{ inputs.release_platform }}" == "TEST_PYPI" ]]; then
pip install -i https://test.pypi.org/simple/ syft==${{ inputs.syft_version }}[data_science];
fi
if [[ "${{ inputs.release_platform }}" == "REAL_PYPI" ]]; then
pip install syft==${{ inputs.syft_version }}[data_science];
fi
- name: Install Hagrid, tox and uv
run: |
pip install -U hagrid
pip install --upgrade pip uv==0.1.18 tox tox-uv==1.5.1 tox-current-env
- name: Run unit tests
run: |
tox -e syft.test.unit --current-env
2 changes: 2 additions & 0 deletions .github/workflows/cd-syft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ jobs:

outputs:
syft_version: ${{ steps.release_checks.outputs.syft_version }}
release_platform: ${{ github.event.inputs.release_platform }}

steps:
- name: Permission to home directory
Expand Down Expand Up @@ -563,3 +564,4 @@ jobs:
uses: OpenMined/PySyft/.github/workflows/cd-post-release-tests.yml@dev
with:
syft_version: ${{ needs.deploy-syft.outputs.syft_version }}
release_platform: ${{ github.event.inputs.release_platform}}

0 comments on commit 581f571

Please sign in to comment.