-
Notifications
You must be signed in to change notification settings - Fork 777
74 lines (64 loc) · 2.63 KB
/
integration-test.yml
File metadata and controls
74 lines (64 loc) · 2.63 KB
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
name: Integration tests
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
python-version: ["3.11"]
ffmpeg-version: ["7"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
id-token: write
contents: read
with:
runner: linux.12xlarge
repository: pytorch/audio
gpu-arch-type: cpu
gpu-arch-version:
timeout: 120
job-name: linux-cpu
script: |
set -ex
# Set up Environment Variables
export PYTHON_VERSION="${{ matrix.python-version }}"
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export PIP_PROGRESS_BAR=off
export CONDA_QUIET=1
# Set UPLOAD_CHANNEL
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export UPLOAD_CHANNEL=test
else
export UPLOAD_CHANNEL=nightly
fi
echo "::group::Create conda env"
# Mark Build Directory Safe
git config --global --add safe.directory /__w/audio/audio
conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" ninja
conda activate ci_env
conda info
ffmpeg -version
python -m pip install --upgrade pip
# We add conda library path as otherwise torchcodec is not
# able to load ffmpeg shared libraries:
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
echo "::endgroup::"
echo "::group::Install TorchAudio integration test and PyTorch dependencies"
python -m pip install parameterized pytest numpy expecttest
echo "::endgroup::"
echo "::group::Install PyTorch and TorchCodec"
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu"
python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")'
python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")'
echo "::endgroup::"
echo "::group::Build and install TorchAudio"
python -m pip install . -v --no-build-isolation
echo "::endgroup::"
echo "::group::Run TorchAudio integration tests"
python -m pip install deep-phonemizer sentencepiece flashlight-text git+https://github.com/kpu/kenlm
pytest test/integration_tests/ -x --use-tmp-hub-dir
echo "::endgroup::"