diff --git a/.github/workflows/cd-post-release-tests.yml b/.github/workflows/cd-post-release-tests.yml index 7f19b5c397d..5aa4329fe03 100644 --- a/.github/workflows/cd-post-release-tests.yml +++ b/.github/workflows/cd-post-release-tests.yml @@ -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: @@ -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: @@ -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 diff --git a/.github/workflows/cd-syft.yml b/.github/workflows/cd-syft.yml index a6b42dcf0ea..cb6c44e8d51 100644 --- a/.github/workflows/cd-syft.yml +++ b/.github/workflows/cd-syft.yml @@ -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 @@ -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}}