ci: restrict tests job to run only on pull requests (#2705)

The 'tests' job relies on the GitHub CLI (`gh`) to parse the commits and
description of an associated pull request to find triggers. When running
on a standard branch push (such as to 'main'), there is no pull request
context, making it impossible to determine which commits to parse.

Also add missing if on steps to make sure nothing runs when
appropriate.
This commit is contained in:
Romaric Jodin 2026-05-26 18:58:19 +02:00 committed by GitHub
parent 60155472ea
commit f6e8964c29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,6 +182,7 @@ jobs:
tests:
name: Run Tests (pocl)
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
- name: Parse triggers
@ -214,8 +215,10 @@ jobs:
git clone --depth 1 https://github.com/KhronosGroup/OpenCL-Headers.git ${{ env.cl-headers }}
git clone --depth 1 https://github.com/KhronosGroup/SPIRV-Headers.git ${{ env.spv-headers }}
- name: Setup Ninja
if: steps.check_triggers.outputs.run_tests == 'true'
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install Vulkan SDK
if: steps.check_triggers.outputs.run_tests == 'true'
uses: humbletim/install-vulkan-sdk@main
with:
version: 1.4.309.0