Skip to content

Ensure packages are installed on images #7991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 69 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,66 @@ jobs:
secrets: inherit
if: ${{ inputs.force || (needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false') || (needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.stable_image_exists != 'true' && needs.checks.outputs.docs_only == 'false') }}

package-tests:
if: ${{ needs.checks.outputs.docs_only != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
name: Package Tests
runs-on: ubuntu-22.04
needs: [checks, binaries, build-docker, build-docker-plus, build-docker-nap]
permissions:
contents: read
pull-requests: write # for package report
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: arm64
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}

- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
with:
token_format: access_token
workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY }}
service_account: ${{ secrets.GCR_SERVICE_ACCOUNT }}
if: ${{ needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' }}

- name: Login to GCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.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' }}

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

- name: Add comment
run: |
# make sure the comment is formatted correctly, as a code block
echo '### Package Report' > output.txt
echo '```' >> output.txt
cat package_output.txt >> output.txt
echo '```' >> output.txt
gh pr comment --edit-last --create-if-none ${{ github.event.pull_request.number }} -F output.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ ( needs.checks.outputs.forked_workflow == 'false' || needs.checks.outputs.docs_only == 'false' ) && github.event.pull_request }}

helm-tests:
if: ${{ needs.checks.outputs.docs_only != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
name: Helm Tests ${{ matrix.base-os }}
Expand Down Expand Up @@ -677,10 +737,12 @@ jobs:
if: ${{ !cancelled() }}
runs-on: ubuntu-22.04
name: Final CI Results
needs: [tag-stable, build-docker, build-docker-plus, build-docker-nap, smoke-tests-oss, smoke-tests-plus, smoke-tests-nap]
needs: [tag-stable, build-docker, build-docker-plus, build-docker-nap, smoke-tests-oss, smoke-tests-plus, smoke-tests-nap, package-tests, helm-tests]
steps:
- run: |
tagResult="${{ needs.tag-stable.result }}"
packageResult="${{ needs.package-tests.result }}"
helmResult="${{ needs.helm-tests.result }}"
smokeOSSResult="${{ needs.smoke-tests-oss.result }}"
smokePlusResult="${{ needs.smoke-tests-plus.result }}"
smokeNAPResult="${{ needs.smoke-tests-nap.result }}"
Expand Down Expand Up @@ -708,6 +770,12 @@ jobs:
if [[ $buildNAPResult != "success" && $buildNAPResult != "skipped" ]]; then
exit 1
fi
if [[ $helmResult != "success" && $helmResult != "skipped" ]]; then
exit 1
fi
if [[ $packageResult != "success" && $packageResult != "skipped" ]]; then
exit 1
fi

trigger-image-promotion:
name: Promote images on Force Run
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
exclude: ^(tests/suite/utils|tests/suite/fixtures|tests/suite/grpc|tests/settings.py)
exclude: ^(tests/suite/utils|tests/suite/fixtures|tests/suite/grpc|tests/settings.py|tests/scripts)
- id: no-commit-to-branch
- id: requirements-txt-fixer
- id: fix-byte-order-marker
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $(MINIKUBE_KUBE_CONFIG_FOLDER): $(KUBE_CONFIG_FOLDER)
setup-venv:
$(PYTHON) -m venv $(ROOT_DIR)/tests/venv;
source $(ROOT_DIR)/tests/venv/bin/activate \
&& pip install --require-hashes -r requirements.txt --no-deps \
&& pip install --require-hashes -r $(ROOT_DIR)/tests/requirements.txt --no-deps \
&& playwright install --with-deps chromium


Expand Down
Loading
Loading