Skip to content

Commit

Permalink
Always run binary upload (#4958)
Browse files Browse the repository at this point in the history
Using `always()` allows binary upload to run even if some binary builds
fails, i.e. text conda 3.12
https://github.com/pytorch/text/actions/runs/7975119767/job/21772574739.
The upload job will also fail expectedly because it couldn't find any
artifacts on GitHub. However, any working combinations will still be
uploaded normally.

I also update the test script to test both minimum (3.8) and maximum
(3.12) versions.

### Testing


https://github.com/pytorch/test-infra/actions/runs/7979242479/job/21786218059?pr=4958
shows that the upload job is run and failed because it couldn't find the
artifacts on GH
  • Loading branch information
huydhn committed Feb 20, 2024
1 parent f0ed4e2 commit b97ddd6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 36 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build_conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ jobs:
with:
repository: ${{ inputs.repository }}
script: ${{ inputs.post-script }}
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/
- name: Smoke Test
env:
PACKAGE_NAME: ${{ inputs.package-name }}
Expand Down Expand Up @@ -217,10 +211,18 @@ jobs:
${CONDA_RUN_SMOKE} python "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
fi
conda env remove -p "${CONDA_ENV_SMOKE}"
# NB: Only upload to GitHub after passing smoke tests
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/

upload:
needs: build
uses: ./.github/workflows/_binary_conda_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build_conda_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ jobs:
with:
repository: ${{ inputs.repository }}
script: ${{ inputs.post-script }}
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/
- name: Smoke Test
shell: bash -l {0}
env:
Expand Down Expand Up @@ -221,6 +215,13 @@ jobs:
export PATH=${OLD_PATH}
conda env remove -p "${CONDA_ENV_SMOKE}"
# NB: Only upload to GitHub after passing smoke tests
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/
- name: Clean up disk space
if: always()
continue-on-error: true
Expand All @@ -229,6 +230,7 @@ jobs:
upload:
needs: build
uses: ./.github/workflows/_binary_conda_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build_conda_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ jobs:
repository: ${{ inputs.repository }}
script: ${{ inputs.post-script }}
is_windows: 'enabled'
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/
- name: Smoke Test
env:
PACKAGE_NAME: ${{ inputs.package-name }}
Expand Down Expand Up @@ -247,10 +241,18 @@ jobs:
${CONDA_RUN_SMOKE} python "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
fi
conda env remove -p "${CONDA_ENV_SMOKE}"
# NB: Only upload to GitHub after passing smoke tests
- name: Upload artifact to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/

upload:
needs: build
uses: ./.github/workflows/_binary_conda_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ jobs:
with:
repository: ${{ inputs.repository }}
script: ${{ inputs.post-script }}
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- name: Smoke Test
shell: bash -l {0}
env:
Expand Down Expand Up @@ -228,10 +222,18 @@ jobs:
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} found"
${CONDA_RUN} python "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
fi
# NB: Only upload to GitHub after passing smoke tests
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/

upload:
needs: build
uses: ./.github/workflows/_binary_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ jobs:
with:
repository: ${{ inputs.repository }}
script: ${{ inputs.post-script }}
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- name: Smoke Test
shell: bash -l {0}
env:
Expand Down Expand Up @@ -203,6 +197,13 @@ jobs:
${CONDA_RUN} python3 "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
fi
export PATH=${OLD_PATH}
# NB: Only upload to GitHub after passing smoke tests
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- name: Clean up disk space
if: always()
continue-on-error: true
Expand All @@ -211,6 +212,7 @@ jobs:
upload:
needs: build
uses: ./.github/workflows/_binary_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@ jobs:
set -euxo pipefail
source "${BUILD_ENV_FILE}"
${CONDA_RUN} ${ENV_SCRIPT} ${POST_SCRIPT}
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- name: Smoke Test
env:
PACKAGE_NAME: ${{ inputs.package-name }}
Expand All @@ -192,13 +186,21 @@ jobs:
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} found"
${CONDA_RUN} python "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
fi
# NB: Only upload to GitHub after passing smoke tests
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- uses: ./test-infra/.github/actions/teardown-windows
if: always()
name: Teardown Windows

upload:
needs: build
uses: ./.github/workflows/_binary_upload.yml
if: always()
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
Expand Down

0 comments on commit b97ddd6

Please sign in to comment.