Skip to content

[no-relnote] Fix E2E matrix conditional #761

[no-relnote] Fix E2E matrix conditional

[no-relnote] Fix E2E matrix conditional #761

Workflow file for this run

# Copyright 2025 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI Pipeline
on:
push:
branches:
- "pull-request/[0-9]+"
- main
- release-*
jobs:
code-scanning:
uses: ./.github/workflows/code_scanning.yaml
variables:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
is_pull_request: ${{ steps.is_pull_request.outputs.is_pull_request }}
steps:
- name: Generate Commit Short SHA
id: version
run: echo "version=$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT"
- name: Determine if push is to main or release branch
id: is_pull_request
run: |
# Extract the branch name from the ref (e.g., refs/heads/main -> main)
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
# If the branch is 'main' or starts with 'release-', this is _not_ a pull request-equivalent push
# Otherwise, treat it as a pull-request branch (e.g., 'pull-request/123')
if [[ "$BRANCH_NAME" == "main" || "$BRANCH_NAME" == release-* ]]; then
echo "is_pull_request=false" >> "$GITHUB_OUTPUT"
else
echo "is_pull_request=true" >> "$GITHUB_OUTPUT"
fi
golang:
uses: ./.github/workflows/golang.yaml
image:
uses: ./.github/workflows/image.yaml
needs: [variables, golang, code-scanning]
secrets: inherit
with:
version: ${{ needs.variables.outputs.version }}
build_multi_arch_images: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}
e2e-test:
needs: [image, variables]
secrets: inherit
uses: ./.github/workflows/e2e.yaml
with:
version: ${{ needs.variables.outputs.version }}
is_pull_request: ${{ needs.variables.outputs.is_pull_request }}