Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ede9fd9
fix bug in run_tests logic
sean-breen Jun 24, 2026
a207440
wider net for docs_only
sean-breen Jun 25, 2026
5742781
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 2, 2026
35c8d2c
fix docs_only detection, and enable for merge queue
sean-breen Jul 2, 2026
c7a72a9
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 2, 2026
caea766
address feedback
sean-breen Jul 7, 2026
9ffea18
Potential fix for pull request finding
sean-breen Jul 7, 2026
531af52
gate all logic via variables.sh
sean-breen Jul 7, 2026
1fa0c69
merge main into chore/sb-ci-updates
sean-breen Jul 7, 2026
b102857
add back missing file
sean-breen Jul 7, 2026
a94baeb
cant use empty needs
sean-breen Jul 8, 2026
1681951
fix tag_stable logic, doesnt run on docs_only
sean-breen Jul 9, 2026
ec1dd2a
allow inspection of which jobs failed
sean-breen Jul 9, 2026
6fba7c7
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 9, 2026
53cc407
update logic around CI flags
sean-breen Jul 9, 2026
02c7b1f
prevent unnecessary rebuilds when modifying files that do not affect …
sean-breen Jul 13, 2026
63a86d2
dont build for helm tests when a stable tag exists
sean-breen Jul 13, 2026
1c99f97
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 13, 2026
abca8c6
add prompts dir to exclusion list
sean-breen Jul 14, 2026
2abbd40
remove redundant run_build variable
sean-breen Jul 14, 2026
cd52acc
full-build only when force is true
sean-breen Jul 15, 2026
db9ef51
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 20, 2026
ed135cf
remove test make targets
sean-breen Jul 20, 2026
04a454a
add ci-preview scripts and make targets
sean-breen Jul 20, 2026
d06c778
Merge branch 'main' into chore/sb-ci-updates
sean-breen Jul 20, 2026
58f6b5f
short-circuit the e2e and tag-stable checks when build-artifacts did …
sean-breen Jul 20, 2026
bb85131
set-matrix
sean-breen Jul 21, 2026
a25440a
fix gating for e2e jobs + final ci results
sean-breen Jul 21, 2026
12ec6a0
Merge branch 'main' into chore/sb-ci-updates
vepatel Jul 22, 2026
65b0338
check for target_exists, and force a rebuild if not
sean-breen Jul 22, 2026
631d567
Merge branch 'main' into chore/sb-ci-updates
sean-breen Aug 5, 2026
9517d8a
Merge branch 'main' into chore/sb-ci-updates
sean-breen Aug 11, 2026
b77abba
Merge branch 'main' into chore/sb-ci-updates
sean-breen Aug 12, 2026
a93dccb
pr feedback
sean-breen Aug 12, 2026
e952897
merge main
sean-breen Aug 12, 2026
05034cb
add developer doc, and update skill
sean-breen Aug 12, 2026
8660787
fix repo paths
sean-breen Aug 12, 2026
63ab118
fix failing test
sean-breen Aug 12, 2026
169ffc9
fix failing test
sean-breen Aug 12, 2026
33c1dd8
fix arch mismatch?
sean-breen Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/scripts/variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,19 @@ get_k8s_latest_version() {
echo "$K8S_LATEST_VERSION"
}

# Outputs docs_only=true if all changed files match doc paths (*.md, docs/**, examples/**)
# Outputs docs_only=true if all changed files (vs. PR/merge base) match doc paths.
# Doc paths include: *.md, docs/**, examples/**, site/**, .github/ISSUE_TEMPLATE/**,
# .github/PULL_REQUEST_TEMPLATE.md, CHANGELOG*, LICENSE, CODEOWNERS.
get_docs_only() {
non_doc_files=$(git diff --name-only HEAD^ | grep -Ev '(\.md$|^docs/|^examples/)')
local range
if [ -n "${GITHUB_BASE_REF:-}" ]; then
# PR or merge_group event: compare against the target branch.
git fetch --quiet --depth=50 origin "${GITHUB_BASE_REF}" 2>/dev/null || true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason for 50 commit depth?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we rely on the the checkout action using a fetch depth of 0 here?

range="origin/${GITHUB_BASE_REF}...HEAD"
else
range="HEAD^...HEAD"
fi
non_doc_files=$(git diff --name-only "${range}" 2>/dev/null | grep -Ev '(\.md$|^docs/|^examples/|^site/|^\.github/ISSUE_TEMPLATE/|^\.github/PULL_REQUEST_TEMPLATE\.md$|^CHANGELOG|^LICENSE$|^CODEOWNERS$)')
Comment thread
sean-breen marked this conversation as resolved.
Outdated
if [ -z "$non_doc_files" ]; then
echo "docs_only=true"
else
Expand Down
74 changes: 31 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
contents: read
id-token: write
outputs:
docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
docs_only: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && steps.docs.outputs.docs_only == 'true' }}
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
go_path: ${{ steps.vars.outputs.go_path }}
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
Expand Down Expand Up @@ -174,14 +174,14 @@ jobs:
run_tests="false"
elif [ "${{ steps.docs.outputs.docs_only }}" = "true" ]; then
run_tests="false"
elif [ "${{ steps.binary-cache.outputs.cache-hit }}" = "true" ] && [ "${{ steps.vars.outputs.stable_image_exists }}" = "true" ]; then
elif [ "${{ steps.binary-cache.outputs.cache-hit }}" = "true" ] && [ "${{ steps.stable_exists.outputs.exists }}" = "true" ]; then
run_tests="false"
fi
echo "run_tests=${run_tests}" >> $GITHUB_OUTPUT

- name: Output variables
run: |
echo docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
echo docs_only: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && steps.docs.outputs.docs_only == 'true' }}
echo k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
echo go_path: ${{ steps.vars.outputs.go_path }}
echo go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
Expand Down Expand Up @@ -248,6 +248,10 @@ jobs:
contents: read
id-token: write
needs: checks
if: >-
inputs.force ||
(needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true')
env:
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
steps:
Expand All @@ -258,22 +262,14 @@ jobs:
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: 'v3.21.2'
if: >-
inputs.force ||
needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true'

- name: Azure login
uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0
with:
client-id: ${{ secrets.AZURE_VAULT_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_VAULT_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_VAULT_SUBSCRIPTION_ID }}
if: >-
inputs.force ||
needs.checks.outputs.forked_workflow == 'false' &&
(needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true')
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Setup secrets
id: secrets
Expand All @@ -282,46 +278,26 @@ jobs:
CODECOV_TOKEN=$(az keyvault secret show --name code-cov --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv)
echo "::add-mask::$CODECOV_TOKEN"
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_OUTPUT
if: >-
inputs.force ||
needs.checks.outputs.forked_workflow == 'false' &&
(needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true')
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Setup Golang Environment
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
if: >-
inputs.force ||
needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true'

- name: Generate secrets for tests
run: |
make secrets
if: >-
inputs.force ||
needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true'

- name: Run Tests
run: make cover
if: >-
inputs.force ||
needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
Comment thread
sean-breen marked this conversation as resolved.
files: ./coverage.txt
token: ${{ steps.secrets.outputs.CODECOV_TOKEN }} # required
if: >-
inputs.force ||
(needs.checks.outputs.forked_workflow == 'false' &&
(needs.checks.outputs.run_tests == 'true' &&
needs.checks.outputs.binary_cache_hit != 'true'))
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

staticcheck:
name: Static Check
Expand Down Expand Up @@ -385,6 +361,10 @@ jobs:
build-artifacts:
name: Build Artifacts
needs: [checks, unit-tests]
if: >-
!cancelled() &&
needs.checks.result == 'success' &&
(needs.unit-tests.result == 'success' || needs.unit-tests.result == 'skipped')
Comment thread
sean-breen marked this conversation as resolved.
Outdated
uses: ./.github/workflows/build-artifacts.yml
with:
force: ${{ needs.checks.outputs.docker_build == 'true' }}
Expand Down Expand Up @@ -445,15 +425,15 @@ jobs:
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
with:
platforms: arm64
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Azure login
uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0
with:
client-id: ${{ secrets.AZURE_VAULT_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_VAULT_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_VAULT_SUBSCRIPTION_ID }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Setup secrets
id: secrets
Expand All @@ -465,7 +445,7 @@ jobs:
GCR_SERVICE_ACCOUNT=$(az keyvault secret show --name kic-pipeline-gcr-sa --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv)
echo "::add-mask::$GCR_SERVICE_ACCOUNT"
echo "GCR_SERVICE_ACCOUNT=$GCR_SERVICE_ACCOUNT" >> $GITHUB_OUTPUT
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Authenticate to Google Cloud
id: auth
Expand All @@ -474,27 +454,27 @@ jobs:
token_format: access_token
workload_identity_provider: ${{ steps.secrets.outputs.GCR_WORKLOAD_ID }}
service_account: ${{ steps.secrets.outputs.GCR_SERVICE_ACCOUNT }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Login to GCR
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Install Python dependencies
run: |
make -f tests/Makefile setup-venv
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Run tests
id: packages
run: |
source tests/venv/bin/activate
python tests/scripts/check_container_packages.py --tag ${{ needs.checks.outputs.build_tag }} --log package_output.txt
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}

- name: Add comment
run: |
Expand All @@ -506,7 +486,7 @@ jobs:
gh pr comment --edit-last --create-if-none ${{ github.event.pull_request.number }} -F output.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment thread
Copilot marked this conversation as resolved.
if: ${{ ( needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' ) && github.event.pull_request }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' && github.event.pull_request }}

helm-tests:
if: >-
Expand Down Expand Up @@ -890,7 +870,7 @@ jobs:
if: ${{ !cancelled() }}
runs-on: ubuntu-24.04
name: Final CI Results
needs: [tag-stable, build-artifacts, smoke-tests-oss, smoke-tests-plus, smoke-tests-nap, package-tests, helm-tests, staticcheck, govulncheck]
needs: [tag-stable, build-artifacts, smoke-tests-oss, smoke-tests-plus, smoke-tests-nap, package-tests, helm-tests, staticcheck, govulncheck, unit-tests, verify-codegen]
steps:
- run: |
tagResult="${{ needs.tag-stable.result }}"
Expand All @@ -902,6 +882,8 @@ jobs:
buildArtifactsResult="${{ needs.build-artifacts.result }}"
staticcheckResult="${{ needs.staticcheck.result }}"
govulncheckResult="${{ needs.govulncheck.result }}"
unitTestsResult="${{ needs.unit-tests.result }}"
verifyCodegenResult="${{ needs.verify-codegen.result }}"
if [[ $tagResult != "success" && $tagResult != "skipped" ]]; then
exit 1
fi
Expand Down Expand Up @@ -929,6 +911,12 @@ jobs:
if [[ $govulncheckResult != "success" && $govulncheckResult != "skipped" ]]; then
exit 1
fi
if [[ $unitTestsResult != "success" && $unitTestsResult != "skipped" ]]; then
exit 1
fi
if [[ $verifyCodegenResult != "success" && $verifyCodegenResult != "skipped" ]]; then
exit 1
fi

trigger-image-promotion:
name: Promote images on Force Run
Expand Down
Loading