fix(deps): update kubernetes packages to v0.32.1 #3437
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- renovate/** | |
schedule: | |
- cron: '0 13 * * *' | |
jobs: | |
chart-lint: | |
name: Helm chart Lint | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
kubernetes-version: ["v1.31.0", "v1.30.0", "v1.29.5", "v1.28.3", "v1.27.5"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: helm/[email protected] | |
- name: Lint charts | |
run: ct --config .github/ct.yaml lint --debug | |
- name: Check for changed installable charts | |
id: list-changed | |
run: | | |
changed=$(ct --config .github/ct.yaml list-changed) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: Run helm unit tests | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm plugin install https://github.com/helm-unittest/helm-unittest | |
for chart in $(ct --config .github/ct.yaml list-changed); do | |
if [ -d "$chart/tests/" ]; then | |
helm unittest $chart | |
else | |
echo "No unit tests found for $chart" | |
fi | |
done | |
- name: Setup Minikube | |
uses: manusa/[email protected] | |
if: steps.list-changed.outputs.changed == 'true' | |
with: | |
minikube version: v1.35.0 | |
kubernetes version: ${{ matrix.kubernetes-version }} | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-go@v5 | |
if: steps.list-changed.outputs.changed == 'true' | |
with: | |
go-version-file: 'go.mod' | |
- name: Create image for chart testing | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
GOOS=linux GOARCH=amd64 make build # Set GOOS and GOARCH explicitly since Dockerfile expects them in the binary name | |
DOCKER_BUILDKIT=1 docker build -t e2e/newrelic-infra-operator:test . | |
minikube image load e2e/newrelic-infra-operator:test | |
kubectl create ns ct | |
- name: Test install charts | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --namespace ct --config .github/ct.yaml --debug | |
- name: Test upgrade charts | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --namespace ct --config .github/ct.yaml --debug --upgrade | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
goos: [ linux ] | |
goarch: [ amd64, arm64, arm ] | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
# A cache entry is will be generated for `key`, and attempted to restore. | |
# If `key` is not found, any partial match for `restore-keys` will be attempted. | |
# Regardless of whether `key` was found or not, it will be created at the end of the run. | |
# With this mechanism, we ensure caches are cycled regularly. | |
- name: Go modules cache | |
uses: actions/[email protected] | |
with: | |
path: ~/go/pkg/mod | |
key: gomod-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
gomod- | |
- name: Build cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.cache/go-build | |
key: gobuild-${{ matrix.goos }}-${{ matrix.goarch }}-${{ github.sha }} | |
restore-keys: | | |
gobuild-${{ matrix.goos }}-${{ matrix.goarch }} | |
- name: Build binary | |
run: make build | |
- name: Build Docker image | |
if: matrix.goos == 'linux' && matrix.goarch == 'amd64' | |
run: make image | |
- name: Run CI checks | |
if: matrix.goos == 'linux' && matrix.goarch == 'amd64' | |
run: make ci | |
integration: | |
name: Run integration and test-e2e tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
id: go | |
- name: Go modules cache | |
uses: actions/[email protected] | |
with: | |
path: ~/go/pkg/mod | |
key: gomod-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
gomod- | |
- name: Build cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.cache/go-build | |
key: gobuild-linux-amd64-${{ github.sha }} | |
restore-keys: | | |
gobuild-linux-amd64 | |
- name: Install kind | |
run: go install sigs.k8s.io/[email protected] | |
- name: Create k8s Kind Cluster | |
run: make kind-up | |
- name: Run tests | |
run: make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 | |
with: | |
fail_ci_if_error: false | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Run integration tests | |
run: make test-integration | |
- name: Build Docker image | |
run: make image-push IMAGE_REPO=localhost:5000/newrelic-infra-operator | |
- name: Create Helm release | |
env: | |
KUBECONFIG: ./kubeconfig | |
run: | | |
helm install newrelic-infra-operator ./charts/newrelic-infra-operator \ | |
--dependency-update \ | |
--values ./values-dev.yaml \ | |
--set image.repository=localhost:5000/newrelic-infra-operator | |
- name: Run test-e2e tests | |
run: make test-e2e | |
static-analysis: | |
name: Static analysis and linting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- uses: newrelic/newrelic-infra-checkers@v1 | |
with: | |
golangci-lint-config: golangci-lint | |
# - name: Semgrep | |
# uses: returntocorp/semgrep-action@v1 | |
# with: | |
# auditOn: push | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
continue-on-error: ${{ github.event_name != 'pull_request' }} | |
with: | |
only-new-issues: true | |
args: --timeout 3m | |
codespell: | |
name: Codespell | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Codespell test | |
uses: codespell-project/actions-codespell@master | |
with: | |
check_filenames: true | |
check_hidden: true | |
skip: ./.git,go.sum | |
ignore_words_list: enver,NotIn |