Build and test Python #189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test Python | |
run-name: ${{ inputs.run_name }} | |
on: | |
workflow_dispatch: | |
inputs: | |
runner_label: | |
description: Runner label, keep empty for default | |
type: string | |
default: "" | |
pytorch_ref: | |
description: PyTorch ref, keep empty for default | |
type: string | |
default: "" | |
upload_test_reports: | |
description: Upload test reports | |
type: boolean | |
default: false | |
ignore_errors: | |
description: Ignore test errors | |
type: boolean | |
default: false | |
skip_list: | |
description: Skip list | |
type: string | |
default: "" | |
run_name: | |
description: Custom run name | |
type: string | |
default: "Build and test" | |
enable_unskip: | |
description: Ignore pytest.skip | |
type: boolean | |
default: false | |
use_pyenv_python: | |
description: Use Python built with pyenv | |
type: boolean | |
default: false | |
permissions: read-all | |
jobs: | |
prepare: | |
name: Prepare | |
runs-on: Linux | |
outputs: | |
matrix: ${{ steps.matrix.outputs.matrix }} | |
steps: | |
- name: Inputs | |
run: | | |
cat <<EOF | |
${{ toJSON(inputs) }} | |
EOF | |
- name: Matrix | |
id: matrix | |
run: | | |
if [[ -n "${{ inputs.runner_label }}" ]]; then | |
matrix='{"python": ["3.9", "3.10", "3.11", "3.12"]}' | |
else | |
matrix='{"python": ["3.9", "3.10", "3.11", "3.12"], "driver": ["rolling", "lts"]}' | |
fi | |
echo "matrix=$matrix" | tee -a $GITHUB_OUTPUT | |
integration-tests: | |
name: Integration tests matrix | |
needs: prepare | |
strategy: | |
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
fail-fast: false | |
uses: ./.github/workflows/build-test-reusable.yml | |
with: | |
driver_version: ${{ matrix.driver }} | |
runner_label: ${{ inputs.runner_label }} | |
pytorch_ref: ${{ inputs.pytorch_ref }} | |
python_version: ${{ matrix.python }} | |
upload_test_reports: ${{ inputs.upload_test_reports }} | |
ignore_errors: ${{ inputs.ignore_errors }} | |
skip_list: ${{ inputs.skip_list }} | |
run_name: ${{ inputs.run_name }} | |
enable_unskip: ${{ inputs.enable_unskip }} | |
use_pyenv_python: ${{ inputs.use_pyenv_python || false }} |