-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[no-relnotes] Use reusable workflows for CI
This commit introduces the following changes to the CI structure. A more agressive split of the CI steps to reusable workflows. We now have the following high-level workflows: - A set of basic checks that are run on PR and can be invoked from a workflow - A full ci pipeline that is run on push to main and release-* branches (as well as PR copy bot branches) - A standalone definition for CodeQL Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
- Loading branch information
1 parent
d1fad7e
commit 12a343d
Showing
7 changed files
with
219 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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: "basic checks" | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "The short SHA to use as a version string" | ||
value: ${{ jobs.variables.outputs.version }} | ||
golang_version: | ||
description: "The golang version for this project" | ||
value: ${{ jobs.variables.outputs.golang_version }} | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
branches: | ||
- main | ||
- release-* | ||
|
||
jobs: | ||
variables: | ||
uses: ./.github/workflows/variables.yaml | ||
|
||
golang: | ||
needs: | ||
- variables | ||
uses: ./.github/workflows/golang.yaml | ||
with: | ||
golang_version: ${{ needs.variables.outputs.golang_version }} | ||
|
||
code-scanning: | ||
needs: | ||
- variables | ||
uses: ./.github/workflows/code_scanning.yaml | ||
with: | ||
golang_version: ${{ needs.variables.outputs.golang_version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 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: | ||
basic: | ||
uses: ./.github/workflows/basic-checks.yaml | ||
|
||
image: | ||
uses: ./.github/workflows/image.yaml | ||
needs: | ||
- basic | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.basic.outputs.version }} | ||
build_multi_arch_images: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 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: "CodeQL" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
golang_version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze Go code with CodeQL | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
permissions: | ||
security-events: write | ||
packages: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ inputs.golang_version }} | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: go | ||
build-mode: manual | ||
|
||
- shell: bash | ||
run: | | ||
make build | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
# | ||
# 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. | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "The short SHA to use as a version string" | ||
value: ${{ jobs.variables.outputs.version }} | ||
golang_version: | ||
description: "The golang version for this project" | ||
value: ${{ jobs.variables.outputs.golang_version }} | ||
|
||
jobs: | ||
variables: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
golang_version: ${{ steps.golang_version.outputs.golang_version }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate Commit Short SHA | ||
id: version | ||
run: echo "version=$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Get Golang Version | ||
id: golang_version | ||
run: | | ||
GOLANG_VERSION=$(./hack/golang-version.sh) | ||
echo "Detected $GOLANG_VERSION" | ||
echo "golang_version=${GOLANG_VERSION}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters