1- name : Build and test MacOS
1+ name : Build and test MacOS wheels
22
33on :
44 pull_request :
@@ -24,6 +24,35 @@ defaults:
2424 shell : bash -l -eo pipefail {0}
2525
2626jobs :
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+
2756 install-and-test :
2857 runs-on : macos-m1-stable
2958 strategy :
3261 python-version : ['3.9']
3362 ffmpeg-version-for-tests : ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
3463 if : ${{ always() }}
64+ needs : build
3565 steps :
66+ - uses : actions/download-artifact@v3
67+ with :
68+ name : pytorch_torchcodec__${{ matrix.python-version }}_cpu_
69+ path : pytorch/torchcodec/dist/
3670 - name : Setup conda env
3771 uses : conda-incubator/setup-miniconda@v3
3872 with :
@@ -45,19 +79,14 @@ jobs:
4579 - name : Install PyTorch
4680 run : |
4781 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+
4888 - name : Check out repo
4989 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
6190 - name : Install ffmpeg, post build
6291 run : |
6392 # Ideally we would have checked for that before installing the wheel,
6998
7099 conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
71100 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
72122 - name : Smoke test
73123 run : |
74124 python test/decoders/manual_smoke_test.py
75125 - name : Run Python tests
76126 run : |
77- pytest test -vvv
127+ pytest test
0 commit comments