|
| 1 | +name: Linux CPU aarch64 |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - nightly |
| 8 | + - main |
| 9 | + - release/* |
| 10 | + tags: |
| 11 | + - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +permissions: |
| 19 | + id-token: write |
| 20 | + contents: write |
| 21 | + |
| 22 | +defaults: |
| 23 | + run: |
| 24 | + shell: bash -l -eo pipefail {0} |
| 25 | + |
| 26 | +jobs: |
| 27 | + |
| 28 | + generate-matrix: |
| 29 | + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main |
| 30 | + with: |
| 31 | + package-type: wheel |
| 32 | + os: linux-aarch64 |
| 33 | + test-infra-repository: pytorch/test-infra |
| 34 | + test-infra-ref: main |
| 35 | + with-xpu: disable |
| 36 | + with-rocm: disable |
| 37 | + with-cuda: disable |
| 38 | + build-python-only: "disable" |
| 39 | + |
| 40 | + build: |
| 41 | + needs: generate-matrix |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + name: Build and Upload Linux aarch64 wheel |
| 45 | + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main |
| 46 | + with: |
| 47 | + repository: meta-pytorch/torchcodec |
| 48 | + ref: "" |
| 49 | + test-infra-repository: pytorch/test-infra |
| 50 | + test-infra-ref: main |
| 51 | + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} |
| 52 | + pre-script: packaging/pre_build_script.sh |
| 53 | + post-script: packaging/post_build_script.sh |
| 54 | + smoke-test-script: packaging/fake_smoke_test.py |
| 55 | + package-name: torchcodec |
| 56 | + trigger-event: ${{ github.event_name }} |
| 57 | + architecture: aarch64 |
| 58 | + build-platform: "python-build-package" |
| 59 | + build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 python -m build --wheel -vvv --no-isolation" |
| 60 | + |
| 61 | + install-and-test: |
| 62 | + runs-on: linux.arm64.2xlarge |
| 63 | + strategy: |
| 64 | + fail-fast: false |
| 65 | + matrix: |
| 66 | + python-version: ['3.10'] |
| 67 | + ffmpeg-version-for-tests: ['7.0.1'] |
| 68 | + needs: build |
| 69 | + steps: |
| 70 | + - name: Check out repo |
| 71 | + uses: actions/checkout@v6 |
| 72 | + |
| 73 | + - name: Remove src/ folder |
| 74 | + run: bash packaging/remove_src.sh |
| 75 | + |
| 76 | + - name: Setup conda env |
| 77 | + uses: conda-incubator/setup-miniconda@v3 |
| 78 | + with: |
| 79 | + auto-update-conda: true |
| 80 | + # Using miniforge instead of miniconda ensures that the default |
| 81 | + # conda channel is conda-forge instead of main/default. This ensures |
| 82 | + # ABI consistency between dependencies: |
| 83 | + # https://conda-forge.org/docs/user/transitioning_from_defaults/ |
| 84 | + miniforge-version: latest |
| 85 | + activate-environment: test |
| 86 | + python-version: ${{ matrix.python-version }} |
| 87 | + |
| 88 | + - name: Update pip |
| 89 | + run: python -m pip install --upgrade pip |
| 90 | + |
| 91 | + - name: Install PyTorch |
| 92 | + run: bash packaging/install_pytorch.sh cpu "torch torchvision" |
| 93 | + |
| 94 | + - uses: actions/download-artifact@v4 |
| 95 | + with: |
| 96 | + name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_aarch64 |
| 97 | + path: dist/ |
| 98 | + |
| 99 | + - name: Install torchcodec from the wheel |
| 100 | + run: bash packaging/install_torchcodec_wheel.sh |
| 101 | + |
| 102 | + - name: Install ffmpeg, post build |
| 103 | + run: bash packaging/install_ffmpeg.sh ${{ matrix.ffmpeg-version-for-tests }} |
| 104 | + |
| 105 | + - name: Install test dependencies |
| 106 | + run: bash packaging/install_test_dependencies.sh |
| 107 | + |
| 108 | + - name: Run Python tests |
| 109 | + run: | |
| 110 | + pytest --override-ini="addopts=-v" test |
0 commit comments