Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defaults:

jobs:
wheel:
runs-on: windows-2022
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
Expand Down
101 changes: 66 additions & 35 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,122 @@ name: pull
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:
inputs:
full-matrix:
type: boolean
required: false
default: false
trigger-linux:
type: boolean
required: false
default: false
trigger-macos:
type: boolean
required: false
default: false
trigger-windows:
type: boolean
required: false
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }} # yamllint disable-line
# Only cancel intermediate builds if on a PR:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
# Cancel running jobs if triggered on a PR or on workflow_dispatch on the same commit.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') || github.event_name == 'workflow_dispatch' }}

jobs:
trigger:
runs-on: ubuntu-latest
outputs:
linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }}
linux-trigger: ${{ steps.set-matrix.outputs.linux-trigger }}
macos-matrix: ${{ steps.set-matrix.outputs.macos-matrix }}
macos-trigger: ${{ steps.set-matrix.outputs.macos-trigger }}
windows-matrix: ${{ steps.set-matrix.outputs.windows-matrix }}
windows-trigger: ${{ steps.set-matrix.outputs.windows-trigger }}
trigger-linux: ${{ steps.set-matrix.outputs.trigger-linux }}
trigger-macos: ${{ steps.set-matrix.outputs.trigger-macos }}
trigger-windows: ${{ steps.set-matrix.outputs.trigger-windows }}
matrix-linux: ${{ steps.set-matrix.outputs.matrix-linux }}
matrix-macos: ${{ steps.set-matrix.outputs.matrix-macos }}
matrix-windows: ${{ steps.set-matrix.outputs.matrix-windows }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure matrix
id: set-matrix
run: |
if [ -n "$GITHUB_EVENT_NAME" ] && [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
filename=".github/workflows/utils/minimal_matrix.json"
set -x
if [ ${{ github.event_name }} = 'pull_request' ]; then
if [ ${{ contains(github.event.pull_request.labels.*.name, 'ci: full') }} == 'true' ]; then
matrix_type="full"
else
matrix_type="minimal"
fi
else
# TODO: Use full_matrix.json once workflows are ready.
filename=".github/workflows/utils/minimal_matrix.json"
matrix_type="full"
fi

# Set Linux matrix
echo ::group::Set Linux matrix
filename=".github/workflows/utils/${matrix_type}_matrix_linux.json"
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": .["cuda-version"][] }]' $filename)
echo "linux-matrix=$matrix" >> $GITHUB_OUTPUT
echo "linux-matrix=$matrix"
echo "matrix-linux=$matrix" >> $GITHUB_OUTPUT
echo "matrix-linux=$matrix"
trigger=${{ contains(github.event.pull_request.labels.*.name, 'os: linux') }}
echo "linux-trigger=$trigger" >> $GITHUB_OUTPUT
echo "linux-trigger=$trigger"
echo "trigger-linux=$trigger" >> $GITHUB_OUTPUT
echo "trigger-linux=$trigger"
echo ::endgroup::

# Set macOS matrix
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": "cpu" }]' $filename)
echo "macos-matrix=$matrix" >> $GITHUB_OUTPUT
echo "macos-matrix=$matrix"
echo ::group::Set macOS matrix
filename=".github/workflows/utils/${matrix_type}_matrix_macos.json"
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": .["cuda-version"][] }]' $filename)
echo "matrix-macos=$matrix" >> $GITHUB_OUTPUT
echo "matrix-macos=$matrix"
trigger=${{ contains(github.event.pull_request.labels.*.name, 'os: macos') }}
echo "macos-trigger=$trigger" >> $GITHUB_OUTPUT
echo "macos-trigger=$trigger"
echo "trigger-macos=$trigger" >> $GITHUB_OUTPUT
echo "trigger-macos=$trigger"
echo ::endgroup::

# Set Windows matrix
echo ::group::Set Windows matrix
filename=".github/workflows/utils/${matrix_type}_matrix_windows.json"
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": .["cuda-version"][] }]' $filename)
echo "windows-matrix=$matrix" >> $GITHUB_OUTPUT
echo "windows-matrix=$matrix"
echo "matrix-windows=$matrix" >> $GITHUB_OUTPUT
echo "matrix-windows=$matrix"
trigger=${{ contains(github.event.pull_request.labels.*.name, 'os: windows') }}
echo "windows-trigger=$trigger" >> $GITHUB_OUTPUT
echo "windows-trigger=$trigger"
echo "trigger-windows=$trigger" >> $GITHUB_OUTPUT
echo "trigger-windows=$trigger"
echo ::endgroup::

linux:
needs: [trigger]
if: ${{ github.event_name == 'pull_request' && needs.trigger.outputs.linux-trigger == 'true' }}
if: ${{ needs.trigger.outputs.trigger-linux == 'true' || inputs.trigger-linux }}
uses: ./.github/workflows/_build_linux.yml
with:
test-matrix: ${{ needs.trigger.outputs.linux-matrix }}
test-matrix: ${{ needs.trigger.outputs.matrix-linux }}

macos:
needs: [trigger]
if: ${{ github.event_name == 'pull_request' && needs.trigger.outputs.macos-trigger == 'true' }}
if: ${{ needs.trigger.outputs.trigger-macos == 'true' || inputs.trigger-macos }}
uses: ./.github/workflows/_build_macos.yml
with:
test-matrix: ${{ needs.trigger.outputs.macos-matrix }}
test-matrix: ${{ needs.trigger.outputs.matrix-macos }}

windows:
needs: [trigger]
if: ${{ github.event_name == 'pull_request' && needs.trigger.outputs.windows-trigger == 'true' }}
if: ${{ needs.trigger.outputs.trigger-windows == 'true' || inputs.trigger-windows }}
uses: ./.github/workflows/_build_windows.yml
with:
test-matrix: ${{ needs.trigger.outputs.windows-matrix }}
test-matrix: ${{ needs.trigger.outputs.matrix-windows }}

status:
needs: [linux, macos, windows]
needs: [trigger, linux, macos, windows]
runs-on: ubuntu-latest
if: always()
steps:
- name: Fail if any build failed or cancelled
if: ${{ contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled') }}
run: |
echo "One or more builds failed or cancelled:"
echo "Linux: ${{ needs.linux.result }}"
echo "macOS: ${{ needs.macos.result }}"
echo "Windows: ${{ needs.windows.result }}"
echo "trigger: ${{ needs.trigger.result }}"
echo "linux: ${{ needs.linux.result }}"
echo "macos: ${{ needs.macos.result }}"
echo "windows: ${{ needs.windows.result }}"
exit 1
47 changes: 47 additions & 0 deletions .github/workflows/utils/full_matrix_macos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"torch-version": "2.7.0",
"python-version": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.6.0",
"python-version": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.5.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.4.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.3.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.2.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.1.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu"]
},
{
"torch-version": "2.0.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9", "3.10"],
"cuda-version": ["cpu"]
}
]
47 changes: 47 additions & 0 deletions .github/workflows/utils/full_matrix_windows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"torch-version": "2.7.0",
"python-version": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"cuda-version": ["cpu", "cu118", "cu126", "cu128"]
},
{
"torch-version": "2.6.0",
"python-version": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"cuda-version": ["cpu", "cu118", "cu124", "cu126"]
},
{
"torch-version": "2.5.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu", "cu118", "cu121", "cu124"]
},
{
"torch-version": "2.4.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu", "cu118", "cu121", "cu124"]
},
{
"torch-version": "2.3.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu", "cu118", "cu121"]
},
{
"torch-version": "2.2.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu118", "cu121"]
},
{
"torch-version": "2.1.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu118", "cu121"]
},
{
"torch-version": "2.0.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu117", "cu118"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9", "3.10"],
"cuda-version": ["cpu", "cu116", "cu117"]
}
]
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[
{
"torch-version": "2.7.0",
"python-version": ["3.13"],
"python-version": ["3.9", "3.13"],
"cuda-version": ["cpu", "cu128"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9"],
"python-version": ["3.9", "3.11"],
"cuda-version": ["cpu"]
}
]
12 changes: 12 additions & 0 deletions .github/workflows/utils/minimal_matrix_macos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"torch-version": "2.7.0",
"python-version": ["3.9", "3.13"],
"cuda-version": ["cpu"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9", "3.10"],
"cuda-version": ["cpu"]
}
]
12 changes: 12 additions & 0 deletions .github/workflows/utils/minimal_matrix_windows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"torch-version": "2.7.0",
"python-version": ["3.9", "3.13"],
"cuda-version": ["cpu", "cu128"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9", "3.10"],
"cuda-version": ["cpu"]
}
]
Loading