-
Notifications
You must be signed in to change notification settings - Fork 84
133 lines (131 loc) · 4.42 KB
/
test_macos_job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Test build/test macos workflow
on:
pull_request:
paths:
- .github/workflows/macos_job.yml
- .github/workflows/test_macos_job.yml
- .github/scripts/run_with_env_secrets.py
workflow_dispatch:
jobs:
test-x86:
uses: ./.github/workflows/macos_job.yml
with:
job-name: "macos-x86-64-py3.8"
runner: macos-12
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-m1:
uses: ./.github/workflows/macos_job.yml
with:
job-name: "macos-arm64-py3.8"
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
submodules: ${{ 'true' }}
timeout: 60
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch'
test-x86-with-repo:
uses: ./.github/workflows/macos_job.yml
with:
job-name: "macos-x86-64-py3.8"
runner: macos-12
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
repository: pytorch/vision
ref: main
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-m1-with-repo:
uses: ./.github/workflows/macos_job.yml
with:
job-name: "macos-arm64-py3.8"
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
repository: pytorch/vision
submodules: "recursive"
ref: main
timeout: 60
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch'
test-upload-artifact:
uses: ./.github/workflows/macos_job.yml
with:
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-s3:
uses: ./.github/workflows/macos_job.yml
with:
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
upload-artifact-to-s3: true
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-download-artifact:
needs: test-upload-artifact
uses: ./.github/workflows/macos_job.yml
with:
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
download-artifact: my-cool-artifact
script: |
grep "hello" "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-secrets-no-filter-var:
uses: ./.github/workflows/macos_job.yml
secrets: inherit
strategy:
matrix:
include:
- runner: macos-m1-stable
- runner: macos-13-xlarge
fail-fast: false
with:
job-name: "test-secrets-no-filter-var"
runner: ${{ matrix.runner }}
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
script: |
[[ "${SECRET_NOT_A_SECRET_USED_FOR_TESTING}" == "SECRET_VALUE" ]] || exit 1
test-secrets-filter-var:
uses: ./.github/workflows/macos_job.yml
secrets: inherit
strategy:
matrix:
include:
- runner: macos-m1-stable
- runner: macos-13-xlarge
fail-fast: false
with:
job-name: "test-secrets-filter-var"
runner: ${{ matrix.runner }}
secrets-env: "NOT_A_SECRET_USED_FOR_TESTING"
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
script: |
[[ "${SECRET_NOT_A_SECRET_USED_FOR_TESTING}" == "SECRET_VALUE" ]] || exit 1