diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index aab2f7829fe50..82c1657c52797 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -309,20 +309,7 @@ jobs: # Tasks that use the just built toolchain below, need extra environment # setup. No harm in it if all of those tasks would get skipped. if: ${{ !cancelled() && steps.build.conclusion == 'success' }} - run: | - # https://github.com/actions/runner/issues/1964 prevents us from using - # the ENTRYPOINT in the image. - env | sort > env_before - if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then - source /runtimes/oneapi-tbb/env/vars.sh; - elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then - source /opt/runtimes/oneapi-tbb/env/vars.sh; - else - echo "no TBB vars in /opt/runtimes or /runtimes"; - fi - env | sort > env_after - comm -13 env_before env_after >> $GITHUB_ENV - rm env_before env_after + uses: ./devops/actions/source-tbb - name: Build E2E tests if: ${{ inputs.e2e_binaries_artifact && !cancelled() && steps.build.conclusion == 'success' }} diff --git a/.github/workflows/sycl-linux-run-tests.yml b/.github/workflows/sycl-linux-run-tests.yml index 47b7108f3509d..c9c9f45c588ad 100644 --- a/.github/workflows/sycl-linux-run-tests.yml +++ b/.github/workflows/sycl-linux-run-tests.yml @@ -253,21 +253,7 @@ jobs: run: | sudo -E bash devops/scripts/install_drivers.sh devops/dependencies.json --all - name: Source OneAPI TBB vars.sh - shell: bash - run: | - # https://github.com/actions/runner/issues/1964 prevents us from using - # the ENTRYPOINT in the image. - env | sort > env_before - if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then - source /runtimes/oneapi-tbb/env/vars.sh; - elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then - source /opt/runtimes/oneapi-tbb/env/vars.sh; - else - echo "no TBB vars in /opt/runtimes or /runtimes"; - fi - env | sort > env_after - comm -13 env_before env_after >> $GITHUB_ENV - rm env_before env_after + uses: ./devops/actions/source-tbb - name: Download SYCL toolchain if: inputs.toolchain_artifact != '' && github.event_name != 'workflow_run' uses: actions/download-artifact@v7 diff --git a/.github/workflows/sycl-weekly.yml b/.github/workflows/sycl-weekly.yml index 0ed966297f4f0..6cfad692dd187 100644 --- a/.github/workflows/sycl-weekly.yml +++ b/.github/workflows/sycl-weekly.yml @@ -85,21 +85,7 @@ jobs: options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN steps: - name: Source OneAPI TBB vars.sh - shell: bash - run: | - # https://github.com/actions/runner/issues/1964 prevents us from using - # the ENTRYPOINT in the image. - env | sort > env_before - if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then - source /runtimes/oneapi-tbb/env/vars.sh; - elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then - source /opt/runtimes/oneapi-tbb/env/vars.sh; - else - echo "no TBB vars in /opt/runtimes or /runtimes"; - fi - env | sort > env_after - comm -13 env_before env_after >> $GITHUB_ENV - rm env_before env_after + uses: ./devops/actions/source-tbb - name: Set up yarpgen run: | git clone https://github.com/intel/yarpgen.git diff --git a/devops/actions/source-tbb/action.yml b/devops/actions/source-tbb/action.yml new file mode 100644 index 0000000000000..7b0897306aca4 --- /dev/null +++ b/devops/actions/source-tbb/action.yml @@ -0,0 +1,20 @@ +name: "Source OneAPI TBB vars.sh" +description: "Sources the TBB vars script and updates GITHUB_ENV." +runs: + using: "composite" + steps: + - shell: bash + run: | + # https://github.com/actions/runner/issues/1964 prevents us from using + # the ENTRYPOINT in the image. + env | sort > env_before + if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then + source /runtimes/oneapi-tbb/env/vars.sh; + elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then + source /opt/runtimes/oneapi-tbb/env/vars.sh; + else + echo "no TBB vars in /opt/runtimes or /runtimes"; + fi + env | sort > env_after + comm -13 env_before env_after >> $GITHUB_ENV + rm env_before env_after