Skip to content

Commit 34d0cad

Browse files
authored
Adding new workflow to call from domain libraries to validate on domain libraries such as text (#1234)
* Testing new workflow Fix naming fix input * Changed comments
1 parent cc8d20c commit 34d0cad

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Validate domain libary
2+
3+
# A reusable workflow that triggers a set of jobs that perform a smoke test / validation of pytorch binaries.
4+
# Optionally restricts validation to the specified OS and channel.
5+
# For the details about parameter values, see:
6+
# pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
7+
on:
8+
workflow_call:
9+
inputs:
10+
os:
11+
description: "Operating system to generate for (linux, windows, macos, macos-arm64)"
12+
required: true
13+
type: string
14+
channel:
15+
description: "Channel to use (nightly, test, release, all)"
16+
required: true
17+
type: string
18+
ref:
19+
description: 'Reference to checkout, defaults to empty'
20+
default: ""
21+
required: false
22+
type: string
23+
package-type:
24+
description: "Package type (conda, wheel, all)"
25+
required: true
26+
type: string
27+
repository:
28+
description: "Path to repository to checkout"
29+
required: true
30+
type: string
31+
smoke_test:
32+
description: "Path to a smoke test script"
33+
required: true
34+
type: string
35+
36+
jobs:
37+
generate-linux-conda-matrix:
38+
if: (inputs.os == 'linux' || inputs.os == 'all') && (inputs.package_type == 'conda' || inputs.package_type == 'all')
39+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
40+
with:
41+
package-type: conda
42+
os: linux
43+
channel: ${{ inputs.channel }}
44+
with-cuda: disable
45+
generate-linux-wheel-matrix:
46+
if: (inputs.os == 'linux' || inputs.os == 'all') && (inputs.package_type == 'wheel' || inputs.package_type == 'all')
47+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
48+
with:
49+
package-type: wheel
50+
os: linux
51+
channel: ${{ inputs.channel || 'nightly' }}
52+
with-cuda: disable
53+
validate-conda-linux:
54+
if: (inputs.os == 'linux' || inputs.os == 'all') && (inputs.package_type == 'conda' || inputs.package_type == 'all')
55+
needs: generate-linux-conda-matrix
56+
strategy:
57+
matrix: ${{ fromJson(needs.generate-linux-conda-matrix.outputs.matrix) }}
58+
fail-fast: false
59+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
60+
name: "text-${{ matrix.package_type }}-${{ matrix.python_version }}"
61+
with:
62+
runner: "linux.2xlarge"
63+
repository: ${{ inputs.repository }}
64+
ref: ${{ inputs.ref || github.ref }}
65+
job-name: "text-${{ matrix.package_type }}-${{ matrix.python_version }}"
66+
script: |
67+
set -ex
68+
export ENV_NAME="conda-env-${{ github.run_id }}"
69+
export DESIRED_PYTHON="${{ matrix.python_version }}"
70+
export PACKAGE_TYPE="${{ matrix.package_type }}"
71+
export CHANNEL="${{ matrix.channel }}"
72+
export SMOKE_TEST="${{ inputs.smoke_test }}"
73+
eval $SMOKE_TEST
74+
validate-wheel-linux:
75+
if: (inputs.os == 'linux' || inputs.os == 'all') && (inputs.package_type == 'wheel' || inputs.package_type == 'all')
76+
needs: generate-linux-wheel-matrix
77+
strategy:
78+
matrix: ${{ fromJson(needs.generate-linux-wheel-matrix.outputs.matrix) }}
79+
fail-fast: false
80+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
81+
name: "text-${{ matrix.package_type }}-${{ matrix.python_version }}"
82+
with:
83+
runner: "linux.2xlarge"
84+
repository: ${{ inputs.repository }}
85+
ref: ${{ inputs.ref || github.ref }}
86+
job-name: "text-${{ matrix.package_type }}-${{ matrix.python_version }}"
87+
script: |
88+
set -ex
89+
export ENV_NAME="conda-env-${{ github.run_id }}"
90+
export DESIRED_PYTHON="${{ matrix.python_version }}"
91+
export PACKAGE_TYPE="${{ matrix.package_type }}"
92+
export CHANNEL="${{ matrix.channel }}"
93+
export SMOKE_TEST="${{ inputs.smoke_test }}"
94+
eval $SMOKE_TEST

0 commit comments

Comments
 (0)