diff --git a/.github/workflows/call-reusable-workflow-to-validate-MacOS-binaries.yml b/.github/workflows/call-reusable-workflow-to-validate-MacOS-binaries.yml new file mode 100644 index 000000000..fe19f1ae1 --- /dev/null +++ b/.github/workflows/call-reusable-workflow-to-validate-MacOS-binaries.yml @@ -0,0 +1,64 @@ +name: Validate MacOS Binaries + +on: + pull_request: + paths: + - .github/workflows/call-reusable-workflow-to-validate-MacOS-binaries.yml + + +jobs: + generate-ARM64-conda-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: conda + os: macos-arm64 + channel: all + + validate-MacOS-ARM64-conda-packages: + needs: generate-ARM64-conda-matrix + uses: ./.github/workflows/validate-MacOS-binaries.yml + name: validate MacOS-ARM64-conda + with: + test-matrix: ${{ needs.generate-ARM64-conda-matrix.outputs.matrix }} + + generate-ARM64-wheel-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: wheel + os: macos-arm64 + channel: all + + validate-MacOS-ARM64-wheel-packages: + needs: generate-ARM64-wheel-matrix + uses: ./.github/workflows/validate-MacOS-binaries.yml + name: validate MacOS-ARM64-wheel + with: + test-matrix: ${{ needs.generate-ARM64-wheel-matrix.outputs.matrix }} + + generate-X86_64-conda-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: conda + os: macos-x86_64 + channel: all + + validate-MacOS-X86_64-conda-packages: + needs: generate-X86_64-conda-matrix + uses: ./.github/workflows/validate-MacOS-binaries.yml + name: validate MacOS-X86_64-conda + with: + test-matrix: ${{ needs.generate-X86_64-conda-matrix.outputs.matrix }} + + generate-X86_64-wheel-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: wheel + os: macos-x86_64 + channel: all + + validate-MacOS-X86_64-wheel-packages: + needs: generate-X86_64-wheel-matrix + uses: ./.github/workflows/validate-MacOS-binaries.yml + name: validate MacOS-X86_64-wheel + with: + test-matrix: ${{ needs.generate-X86_64-wheel-matrix.outputs.matrix }} diff --git a/.github/workflows/validate-MacOS-binaries.yml b/.github/workflows/validate-MacOS-binaries.yml new file mode 100644 index 000000000..de07bb80e --- /dev/null +++ b/.github/workflows/validate-MacOS-binaries.yml @@ -0,0 +1,33 @@ +name: Validate MacOS Binaries + +on: + workflow_call: + inputs: + test-matrix: + description: "The MacOS JSON Matrix to test" + default: "" + type: string + +jobs: + validate: + strategy: + fail-fast: false + matrix: ${{ fromJSON(inputs.test-matrix) }} + env: + PYTHON_VERSION: ${{ matrix.python_version }} + INSTALLATION: ${{ matrix.installation }} + runs-on: ${{ matrix.validation_runner }} + steps: + - name: Checkout PyTorch/Builder directory + uses: actions/checkout@v3 + - name: Setup miniconda + uses: pytorch/test-infra/.github/actions/setup-miniconda@main + - name: Conda Install pytorch and smoke test + env: + ENV_NAME: conda-env-${{ github.run_id }} + run: | + set -ex + conda create -yp ${ENV_NAME} python=${PYTHON_VERSION} numpy + conda run -p ${ENV_NAME} $INSTALLATION + conda run -p ${ENV_NAME} python3 ${GITHUB_WORKSPACE}/test/smoke_test/smoke_test.py + conda env remove -p ${ENV_NAME} diff --git a/test/smoke_test/smoke_test.py b/test/smoke_test/smoke_test.py index 88df803b7..bae7a5d29 100644 --- a/test/smoke_test/smoke_test.py +++ b/test/smoke_test/smoke_test.py @@ -5,8 +5,8 @@ import torchaudio def smoke_test_cuda() -> None: - gpu_arch_ver = os.environ['GPU_ARCH_VER'] - gpu_arch_type = os.environ['GPU_ARCH_TYPE'] + gpu_arch_ver = os.getenv('GPU_ARCH_VER') + gpu_arch_type = os.getenv('GPU_ARCH_TYPE') is_cuda_system = gpu_arch_type == "cuda" if(not torch.cuda.is_available() and is_cuda_system):