|
| 1 | +name: Create container with pre-built tests |
| 2 | + |
| 3 | +# The purpose of this is to build E2E tests with the latest release toolchain |
| 4 | +# and then run them with the trunk SYCL RT (libsycl.so and friends) to verify |
| 5 | +# that ABI compatibility hasn't been broken. |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + ref: |
| 11 | + type: string |
| 12 | + description: tag/sha |
| 13 | + required: true |
| 14 | + default: |
| 15 | + |
| 16 | + push: |
| 17 | + branches: |
| 18 | + - sycl-rel-** |
| 19 | + |
| 20 | +permissions: read-all |
| 21 | + |
| 22 | +jobs: |
| 23 | + build: |
| 24 | + uses: ./.github/workflows/sycl-linux-build.yml |
| 25 | + with: |
| 26 | + build_ref: ${{ inputs.ref || github.sha }} |
| 27 | + build_cache_root: "/__w/" |
| 28 | + |
| 29 | + build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest" |
| 30 | + cc: clang |
| 31 | + cxx: clang++ |
| 32 | + |
| 33 | + changes: '[]' |
| 34 | + |
| 35 | + toolchain_artifact: toolchain |
| 36 | + toolchain_artifact_filename: toolchain.tar.zst |
| 37 | + e2e_binaries_artifact: e2e_bin |
| 38 | + |
| 39 | + # Couldn't make it work from inside the container, so have to use an extra job |
| 40 | + # and pass an artifact. |
| 41 | + docker: |
| 42 | + runs-on: [Linux, build] |
| 43 | + needs: build |
| 44 | + permissions: |
| 45 | + packages: write |
| 46 | + if: always() |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + with: |
| 50 | + sparse-checkout: | |
| 51 | + devops/ |
| 52 | +
|
| 53 | + - name: Checkout E2E tests |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + ref: ${{ inputs.ref || github.sha }} |
| 57 | + path: llvm |
| 58 | + sparse-checkout: | |
| 59 | + llvm/utils/lit |
| 60 | + sycl/test-e2e |
| 61 | + - name: Pack sources |
| 62 | + run: | |
| 63 | + tar -I 'zstd -9' -cf devops/e2e_sources.tar.zst -C ./llvm . |
| 64 | +
|
| 65 | + - name: Download toolchain |
| 66 | + uses: actions/download-artifact@v4 |
| 67 | + with: |
| 68 | + name: toolchain |
| 69 | + path: devops/ |
| 70 | + - name: Download E2E binaries |
| 71 | + uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + name: e2e_bin |
| 74 | + path: devops/ |
| 75 | + |
| 76 | + |
| 77 | + - name: Build container |
| 78 | + uses: ./devops/actions/build_container |
| 79 | + with: |
| 80 | + push: true |
| 81 | + file: release_tests_binaries |
| 82 | + username: ${{ github.repository_owner }} |
| 83 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + tags: | |
| 85 | + ghcr.io/${{ github.repository }}/sycl_prebuilt_tests:${{ inputs.ref || github.ref_name }} |
| 86 | +
|
| 87 | + run-e2e: |
| 88 | + # Ensure those tests can actually pass with the toolchain they were built |
| 89 | + # with, otherwise testing compatibility with those binaries is pointless. |
| 90 | + # This job should be aligned with how the image will be used in trunk CI. |
| 91 | + # |
| 92 | + # I'll start with just a single configuration, but this might be extended |
| 93 | + # with a matrix in future (e.g., to run on cpu/CUDA/AMDGPU). |
| 94 | + name: Run E2E tests with SYCL RT they were built with |
| 95 | + runs-on: [Linux, pvc] |
| 96 | + needs: [docker, build] |
| 97 | + if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }} |
| 98 | + container: |
| 99 | + image: ghcr.io/${{ github.repository }}/sycl_prebuilt_tests:${{ inputs.ref || github.ref_name }} |
| 100 | + options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN |
| 101 | + steps: |
| 102 | + - uses: actions/checkout@v4 |
| 103 | + with: |
| 104 | + sparse-checkout: | |
| 105 | + devops |
| 106 | + - run: | |
| 107 | + mkdir toolchain |
| 108 | + tar -I 'zstd' -xf /sycl-prebuilt/toolchain.tar.zst -C toolchain |
| 109 | + echo LD_LIBRARY_PATH=$PWD/toolchain/lib:$LD_LIBRARY_PATH >> $GITHUB_ENV |
| 110 | + echo PATH=$PWD/toolchain/bin:$PATH >> $GITHUB_ENV |
| 111 | + - run: | |
| 112 | + sycl-ls |
| 113 | + - name: Run E2E tests |
| 114 | + uses: ./devops/actions/run-tests/e2e |
| 115 | + timeout-minutes: 20 |
| 116 | + with: |
| 117 | + testing_mode: run-only |
| 118 | + target_devices: level_zero:gpu |
0 commit comments