Skip to content

Add test helm upgrade path #4801

Add test helm upgrade path

Add test helm upgrade path #4801

Workflow file for this run

name: Test
on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: ['*']
merge_group:
types: [ checks_requested ]
schedule:
- cron: "15 1 * * *"
workflow_dispatch:
jobs:
pre-job:
runs-on: ubuntu-latest
name: Pre job checks
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- uses: actions/checkout@v4
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**.adoc", "**.md", "examples/**", "LICENSE"]'
unit-tests:
name: Unit Tests
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
strategy:
matrix:
go-version: [1.22.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make test
run: |
make test-unit
- name: Upload unit-test coverage reports to CodeCov
# more at https://github.com/codecov/codecov-action
# Only run if the feature branch is in your repo (not in a fork)
# as Tokenless uploading is rate limited for public repos
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
fail_ci_if_error: false
verbose: true
controllers-integration-tests:
name: Integration Tests for kuadrant-operator/controllers
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
strategy:
matrix:
include:
- gatewayapi-provider: istio
istio-type: istioctl
- gatewayapi-provider: istio
istio-type: sail
- gatewayapi-provider: envoygateway
fail-fast: false
runs-on: ubuntu-latest
env:
KIND_CLUSTER_NAME: kuadrant-test
KUADRANT_NAMESPACE: kuadrant-system
defaults:
run:
shell: bash
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.23.0
config: utils/kind-cluster.yaml
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Check cluster info
run: |
kubectl cluster-info dump
- name: Run make env-setup GATEWAYAPI_PROVIDER=${{ matrix.gatewayapi-provider }} ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }}
run: |
make env-setup GATEWAYAPI_PROVIDER=${{ matrix.gatewayapi-provider }} ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }}
- name: Run integration tests
run: |
make test-integration GATEWAYAPI_PROVIDER=${{ matrix.gatewayapi-provider }}
- name: Upload integration-test coverage reports to CodeCov
# more at https://github.com/codecov/codecov-action
# Only run if the feature branch is in your repo (not in a fork)
# as Tokenless uploading is rate limited for public repos
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: controllers-integration
fail_ci_if_error: false
verbose: true
- name: Check kuadrant status
if: always()
run: |
kubectl get pods -n kuadrant-system
bare-k8s-integration-tests:
name: Integration Tests for kuadrant-operator/tests/bare_k8s
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
env:
KIND_CLUSTER_NAME: kuadrant-test
KUADRANT_NAMESPACE: kuadrant-system
defaults:
run:
shell: bash
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.23.0
config: utils/kind-cluster.yaml
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Check cluster info
run: |
kubectl cluster-info dump
- name: Run make k8s-env-setup
run: |
make k8s-env-setup
- name: Run integration tests
run: |
make test-bare-k8s-integration
- name: Upload integration-test coverage reports to CodeCov
# more at https://github.com/codecov/codecov-action
# Only run if the feature branch is in your repo (not in a fork)
# as Tokenless uploading is rate limited for public repos
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: bare-k8s-integration
fail_ci_if_error: false
verbose: true
gatewayapi-integration-tests:
name: Integration Tests for kuadrant-operator/tests/gatewayapi
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
env:
KIND_CLUSTER_NAME: kuadrant-test
KUADRANT_NAMESPACE: kuadrant-system
defaults:
run:
shell: bash
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.23.0
config: utils/kind-cluster.yaml
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Check cluster info
run: |
kubectl cluster-info dump
- name: Run make gatewayapi-env-setup
run: |
make gatewayapi-env-setup
- name: Run integration tests
run: |
make test-gatewayapi-env-integration
- name: Upload integration-test coverage reports to CodeCov
# more at https://github.com/codecov/codecov-action
# Only run if the feature branch is in your repo (not in a fork)
# as Tokenless uploading is rate limited for public repos
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: gatewayapi-integration
fail_ci_if_error: false
verbose: true
gatewayapi-provider-integration-tests:
name: Integration Tests for kuadrant-operator/tests/[gatewayapi-provider]
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
strategy:
matrix:
include:
- gatewayapi-provider: istio
istio-type: istioctl
- gatewayapi-provider: istio
istio-type: sail
- gatewayapi-provider: envoygateway
fail-fast: false
runs-on: ubuntu-latest
env:
KIND_CLUSTER_NAME: kuadrant-test
KUADRANT_NAMESPACE: kuadrant-system
defaults:
run:
shell: bash
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.23.0
config: utils/kind-cluster.yaml
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Check cluster info
run: |
kubectl cluster-info dump
- name: Run make ${{ matrix.gatewayapi-provider }}-env-setup ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }}
run: |
make ${{ matrix.gatewayapi-provider }}-env-setup ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }}
- name: Run integration tests
run: |
make test-${{ matrix.gatewayapi-provider }}-env-integration
- name: Upload integration-test coverage reports to CodeCov
# more at https://github.com/codecov/codecov-action
# Only run if the feature branch is in your repo (not in a fork)
# as Tokenless uploading is rate limited for public repos
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.gatewayapi-provider }}-integration
fail_ci_if_error: false
verbose: true
- name: Check kuadrant status
if: always()
run: |
kubectl get pods -n kuadrant-system
verify-manifests:
name: Verify manifests
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-manifests
run: |
make verify-manifests
verify-bundle:
name: Verify bundle
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-bundle
run: |
make verify-bundle
verify-fmt:
name: Verify fmt
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-fmt
run: |
make verify-fmt
test-scripts:
name: Test Scripts
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
strategy:
matrix:
go-version: [1.22.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make operator-sdk
run: |
make operator-sdk
verify-generate:
name: Verify generate
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-generate
verify-go-mod:
name: Verify go.mod
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-go-mod
verify-helm-charts:
name: Verify helm charts
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-helm-charts
run: |
make verify-helm-charts
required-checks:
name: Test Required Checks
# This check adds a list of checks to one job to simplify adding settings to the repo.
# If a new check is added in this file, and it should be retested on entry to the merge queue,
# it needs to be added to the list below aka needs: [ existing check 1, existing check 2, new check ].
needs: [ unit-tests, controllers-integration-tests, bare-k8s-integration-tests, gatewayapi-integration-tests, gatewayapi-provider-integration-tests, verify-manifests, verify-bundle, verify-fmt, test-scripts, verify-generate, verify-go-mod, verify-helm-charts ]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo '${{ toJSON(needs) }}' | jq -e 'all(.[]; .result == "success" or .result == "skipped")'