9
9
- release/*
10
10
workflow_dispatch :
11
11
12
- env :
13
- CHANNEL : " nightly"
14
-
15
12
jobs :
16
- tests :
13
+ build :
14
+ strategy :
15
+ matrix :
16
+ python-version : ["3.11"]
17
+ ffmpeg-version : ["7"]
18
+ fail-fast : false
17
19
uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
20
+ permissions :
21
+ id-token : write
22
+ contents : read
18
23
with :
19
24
runner : macos-m1-stable
20
25
repository : pytorch/audio
@@ -25,13 +30,12 @@ jobs:
25
30
git config --global --add safe.directory /__w/audio/audio
26
31
27
32
# Set up Environment Variables
28
- export PYTHON_VERSION="3.10"
33
+ export PYTHON_VERSION="${{ matrix.python-version }}"
34
+ export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
29
35
export PIP_PROGRESS_BAR=off
30
36
export CONDA_QUIET=1
31
37
export CU_VERSION=""
32
- export CUDATOOLKIT=""
33
38
export USE_OPENMP="0"
34
- unset CUDA_VERSION
35
39
36
40
# Set CHANNEL
37
41
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
40
44
export UPLOAD_CHANNEL=nightly
41
45
fi
42
46
47
+ echo "::group::Create conda environment"
48
+ # Mark Build Directory Safe
49
+ git config --global --add safe.directory /__w/audio/audio
50
+ conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja
51
+ conda activate ci_env
52
+ conda info
53
+ ffmpeg -version
54
+ python -m pip install --upgrade pip
55
+ echo "::endgroup::"
56
+
57
+ echo "::group::Install TorchAudio test and PyTorch dependencies"
58
+ python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest
59
+ echo "::endgroup::"
60
+
61
+ echo "::group::Install PyTorch and TorchCodec"
62
+ PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu"
63
+ python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
64
+ python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")'
65
+ python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")'
66
+ echo "::endgroup::"
67
+
68
+ echo "::group::Build and install TorchAudio"
69
+ export BUILD_CPP_TEST=1
70
+ python -m pip install . -v --no-build-isolation
71
+ echo "::endgroup::"
72
+
73
+ echo "::group::Run TorchAudio C tests"
74
+ (cd build/temp*/test/cpp && ./wall_collision)
75
+ echo "::endgroup::"
76
+
77
+ echo "::group::Run TorchAudio tests"
43
78
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true
44
79
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true
45
80
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true
@@ -54,15 +89,10 @@ jobs:
54
89
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true
55
90
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true
56
91
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true
57
- echo '::endgroup::'
58
-
59
- set -euxo pipefail
60
-
61
- echo '::group::Install PyTorch and Torchaudio'
62
- ./.github/scripts/unittest-linux/install.sh
63
- echo '::endgroup::'
92
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CTC_DECODER=true
93
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_unidecode=true
94
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_inflect=true
95
+ export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_pytorch_lightning=true
64
96
65
- echo '::group::Run Tests'
66
- export PYTEST_K_EXTRA="and not librosa"
67
- ./.github/scripts/unittest-linux/run_test.sh
68
- echo '::endgroup::'
97
+ pytest test/torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa" -x
98
+ echo "::endgroup::"
0 commit comments