1
- name : Build and test MacOS
1
+ name : Build and test MacOS wheels
2
2
3
3
on :
4
4
pull_request :
@@ -24,6 +24,35 @@ defaults:
24
24
shell : bash -l -eo pipefail {0}
25
25
26
26
jobs :
27
+ generate-matrix :
28
+ uses : pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
29
+ with :
30
+ package-type : wheel
31
+ os : macos-arm64
32
+ test-infra-repository : pytorch/test-infra
33
+ test-infra-ref : main
34
+ with-xpu : disable
35
+ with-rocm : disable
36
+ with-cuda : disable
37
+ build :
38
+ needs : generate-matrix
39
+ strategy :
40
+ fail-fast : false
41
+ name : Build and Upload Mac wheel
42
+ uses : pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
43
+ with :
44
+ repository : pytorch/torchcodec
45
+ ref : " "
46
+ test-infra-repository : pytorch/test-infra
47
+ test-infra-ref : main
48
+ build-matrix : ${{ needs.generate-matrix.outputs.matrix }}
49
+ post-script : packaging/post_build_script.sh
50
+ smoke-test-script : packaging/fake_smoke_test.py
51
+ runner-type : macos-m1-stable
52
+ package-name : torchcodec
53
+ trigger-event : ${{ github.event_name }}
54
+ env-var-script : packaging/wheel_env.sh
55
+
27
56
install-and-test :
28
57
runs-on : macos-m1-stable
29
58
strategy :
32
61
python-version : ['3.9']
33
62
ffmpeg-version-for-tests : ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
34
63
if : ${{ always() }}
64
+ needs : build
35
65
steps :
66
+ - uses : actions/download-artifact@v3
67
+ with :
68
+ name : pytorch_torchcodec__${{ matrix.python-version }}_cpu_
69
+ path : pytorch/torchcodec/dist/
36
70
- name : Setup conda env
37
71
uses : conda-incubator/setup-miniconda@v3
38
72
with :
@@ -45,19 +79,14 @@ jobs:
45
79
- name : Install PyTorch
46
80
run : |
47
81
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
82
+ - name : Install torchcodec from the wheel
83
+ run : |
84
+ wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
85
+ echo Installing $wheel_path
86
+ python -m pip install $wheel_path -vvv
87
+
48
88
- name : Check out repo
49
89
uses : actions/checkout@v3
50
- - name : Install compile from source dependencies
51
- run : |
52
- conda install cmake pkg-config -c conda-forge
53
- - name : Install test dependencies
54
- run : |
55
- python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
56
- # Ideally we would find a way to get those dependencies from pyproject.toml
57
- python -m pip install numpy pytest pillow
58
- - name : Install torchcodec from source, building against non-GPL FFmpeg
59
- run : |
60
- BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 pip install -e ".[dev]" --no-build-isolation
61
90
- name : Install ffmpeg, post build
62
91
run : |
63
92
# Ideally we would have checked for that before installing the wheel,
69
98
70
99
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
71
100
ffmpeg -version
101
+
102
+ - name : Install test dependencies
103
+ run : |
104
+ python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
105
+ # Ideally we would find a way to get those dependencies from pyproject.toml
106
+ python -m pip install numpy pytest pillow
107
+
108
+ - name : Delete the src/ folder just for fun
109
+ run : |
110
+ # The only reason we checked-out the repo is to get access to the
111
+ # tests. We don't care about the rest. Out of precaution, we delete
112
+ # the src/ folder to be extra sure that we're running the code from
113
+ # the installed wheel rather than from the source.
114
+ # This is just to be extra cautious and very overkill because a)
115
+ # there's no way the `torchcodec` package from src/ can be found from
116
+ # the PythonPath: the main point of `src/` is precisely to protect
117
+ # against that and b) if we ever were to execute code from
118
+ # `src/torchcodec`, it would fail loudly because the built .so files
119
+ # aren't present there.
120
+ rm -r src/
121
+ ls
72
122
- name : Smoke test
73
123
run : |
74
124
python test/decoders/manual_smoke_test.py
75
125
- name : Run Python tests
76
126
run : |
77
- pytest test -vvv
127
+ pytest test
0 commit comments