chore(deps): update ghcr.io/akuity/kargo-charts/kargo docker tag to v1.8.1 #2509
This file contains hidden or 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
name: K8S E2E Tests | |
on: | |
merge_group: | |
pull_request: | |
# paths: | |
# - kubernetes-services/** | |
# - test/** | |
# - go.mod | |
# - renovate.json | |
# - .github/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
analyze-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
apps_any_changed: ${{ steps.changed-files.outputs.apps_any_changed }} | |
apps_all_changed_files: ${{ steps.changed-files.outputs.apps_all_changed_files }} | |
istio_any_changed: ${{ steps.changed-files.outputs.istio_any_changed }} | |
istio_all_changed_files: ${{ steps.changed-files.outputs.istio_all_changed_files }} | |
storage_any_changed: ${{ steps.changed-files.outputs.storage_any_changed }} | |
storage_all_changed_files: ${{ steps.changed-files.outputs.storage_all_changed_files }} | |
k3s_upgrade_any_changed: ${{ steps.changed-files.outputs.k3s_upgrade_any_changed }} | |
k3s_upgrade_all_changed_files: ${{ steps.changed-files.outputs.k3s_upgrade_all_changed_files }} | |
cloudflare_any_changed: ${{ steps.changed-files.outputs.cloudflare_any_changed }} | |
cloudflare_all_changed_files: ${{ steps.changed-files.outputs.cloudflare_all_changed_files }} | |
http_echo_server_any_changed: ${{ steps.changed-files.outputs.http_echo_server_any_changed }} | |
http_echo_server_all_changed_files: ${{ steps.changed-files.outputs.http_echo_server_all_changed_files }} | |
go_test_any_changed: ${{ steps.changed-files.outputs.go_test_any_changed }} | |
go_test_all_changed_files: ${{ steps.changed-files.outputs.go_test_all_changed_files }} | |
go_helper_any_changed: ${{ steps.changed-files.outputs.go_helper_any_changed }} | |
steps: | |
- uses: tj-actions/[email protected] | |
id: changed-files | |
with: | |
files_yaml: | | |
apps: | |
- kubernetes-services/templates/** | |
- '!kubernetes-services/templates/istio**.yaml' | |
- '!kubernetes-services/templates/snapshot-controller.yaml' | |
- '!kubernetes-services/templates/longhorn.yaml' | |
istio: | |
- kubernetes-services/templates/istio** | |
storage: | |
- kubernetes-services/templates/snapshot-controller.yaml | |
- kubernetes-services/templates/longhorn.yaml | |
k3s_upgrade: | |
- 'kubernetes-services/additions/k3s-upgrade-controller/*' | |
cloudflare: | |
- 'kubernetes-services/additions/cloudflare-tunnel/*' | |
http_echo_server: | |
- 'kubernetes-services/additions/http-echo-server/*' | |
go_test: | |
- test/**_test.go | |
go_helper: | |
- test/pkg/**/**.go | |
- go.mod | |
- .github/** | |
test-kubernetes-manifest: | |
needs: analyze-changes | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: yokawasa/[email protected] | |
with: | |
kubectl: '1.29.0' | |
helm: '3.15.1' | |
- uses: actions/setup-go@v6 | |
with: | |
go-version: '1.25' | |
cache-dependency-path: go.sum | |
- name: Test Common Helm Chart | |
if: ${{ needs.analyze-changes.outputs.apps_any_changed == 'true' }} | |
env: | |
HELM_CHARTS_CHANGED_FILES: ${{ needs.analyze-changes.outputs.apps_all_changed_files }} | |
run: | | |
echo "List all helm charts that have changed" | |
for chart in ${HELM_CHARTS_CHANGED_FILES}; do | |
echo "${chart} was changed" | |
test="test/$(basename ${chart} | sed -E 's/-([a-z])/_\1/g' | sed 's/.yaml/_test.go/')" | |
if [ ! -f ${test} ]; then | |
echo "Test coverage ${test} not found. bye!" | |
exit 2 | |
fi | |
go test -v ./test -run $(basename ${chart} .yaml | sed 's/.*/Test\u&/' | sed -E 's/-([a-z])/\U\1/g') | |
done | |
- name: Test Istio Helm Chart | |
if: ${{ needs.analyze-changes.outputs.istio_any_changed == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
run: | | |
go test -v ./test -run TestIstio | |
- name: Test Longhorn and Snapshot Controller Charts | |
if: ${{ needs.analyze-changes.outputs.storage_any_changed == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
run: | | |
go test -v ./test -run TestStorage | |
- name: Test K3S System Upgrade Controller | |
if: ${{ needs.analyze-changes.outputs.k3s_upgrade_any_changed == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
run: | | |
go test -v ./test -run TestK3sSystemUpgradeController | |
- name: Test Cloudflare Tunnel | |
if: ${{ needs.analyze-changes.outputs.cloudflare_any_changed == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
run: | | |
go test -v ./test -run TestCloudflareTunnel | |
- name: Http Echo Server | |
if: ${{ needs.analyze-changes.outputs.http_echo_server == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
run: | | |
go test -v ./test -run TestHttpEchoServer | |
- name: Golang Tests | |
if: ${{ needs.analyze-changes.outputs.go_test_any_changed == 'true' && needs.analyze-changes.outputs.go_helper_any_changed != 'true' }} | |
env: | |
GO_TEST_CHANGED_FILES: ${{ needs.analyze-changes.outputs.go_test_all_changed_files }} | |
run: | | |
for test in ${GO_TEST_CHANGED_FILES}; do | |
echo "${test} was changed" | |
go test -v ./test -run $(basename ${test} _test.go | sed 's/.*/Test\u&/' | sed -E 's/_([a-z])/\U\1/g') | |
done | |
- name: Golang Test Helper | |
if: ${{ needs.analyze-changes.outputs.go_helper_any_changed == 'true' }} | |
run: | | |
go test -v ./test | |
- name: Upload KinD logs | |
if: always() | |
uses: actions/[email protected] | |
with: | |
name: kind | |
path: 'test/kind-logs' | |
retention-days: 3 | |
create-argocd-diff: | |
needs: analyze-changes | |
if: ${{ needs.analyze-changes.outputs.apps_any_changed == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
path: pull-request | |
- uses: actions/checkout@v5 | |
with: | |
ref: main | |
path: main | |
- name: Generate Diff | |
run: | | |
docker run \ | |
--network=host \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v $(pwd)/main:/base-branch \ | |
-v $(pwd)/pull-request:/target-branch \ | |
-v $(pwd)/output:/output \ | |
-e TARGET_BRANCH=${{ github.head_ref }} \ | |
-e REPO=${{ github.repository }} \ | |
dagandersen/argocd-diff-preview:v0.0.25 | |
- name: Post diff as comment | |
run: | | |
gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file output/diff.md --edit-last || \ | |
gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file output/diff.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |