Update prometheus version #1334
Workflow file for this run
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: Push/PR pipeline | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - renovate/** | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| # NOTICE that apart from this, the versions in the chart linter matrix needs to be bumped too. | |
| LATEST_K8S_VERSION: 'v1.35.0' | |
| MINIKUBE_VERSION: 'v1.38.1' | |
| jobs: | |
| chart-lint: | |
| name: Helm chart Lint | |
| runs-on: ubuntu-24.04 # Pinning this version is needed till k8s 1.16, 1.17, 1.18 are supported/tested | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| kubernetes-version: ["v1.35.0", "v1.34.0", "v1.33.0", "v1.32.0", "v1.31.0"] | |
| steps: | |
| - uses: azure/setup-helm@v5 | |
| with: | |
| version: v4.2.3 #Do NOT update to v4 until https://github.com/helm-unittest/helm-unittest/issues/777 is resolved | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: helm/chart-testing-action@v2.8.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - 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 "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run helm unit tests | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: | | |
| helm plugin install https://github.com/helm-unittest/helm-unittest --version=1.1.0 | |
| 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 | |
| - uses: actions/setup-go@v6 | |
| if: steps.list-changed.outputs.changed == 'true' | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Check README.md is up to date | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: | | |
| go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0 | |
| make build-chart-docs | |
| if [ ! -z "$(git status --porcelain)" ]; then | |
| git diff | |
| exit 1 | |
| fi | |
| - name: Setup Minikube | |
| uses: manusa/actions-setup-minikube@v2.18.0 | |
| if: steps.list-changed.outputs.changed == 'true' | |
| with: | |
| minikube version: ${{ env.MINIKUBE_VERSION }} | |
| kubernetes version: ${{ matrix.kubernetes-version }} | |
| # default driver doesn't support 'eval $$(minikube docker-env)'. | |
| driver: docker | |
| github token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create image for chart testing | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: | | |
| make build-multiarch | |
| GOOS=linux GOARCH=amd64 DOCKER_BUILDKIT=1 docker build -t ct/prometheus-configurator:ct . | |
| minikube image load ct/prometheus-configurator:ct | |
| 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 | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Run unit tests | |
| run: make test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Setup Minikube | |
| uses: manusa/actions-setup-minikube@v2.18.0 | |
| with: | |
| minikube version: ${{ env.MINIKUBE_VERSION }} | |
| kubernetes version: ${{ env.LATEST_K8S_VERSION }} | |
| driver: docker | |
| github token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run integration tests | |
| run: make integration-test | |
| static-analysis: | |
| name: Static analysis and linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v6 | |
| 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@v9 | |
| continue-on-error: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| only-new-issues: true | |
| - name: Prometheus versions match | |
| run: make check-prometheus-version | |
| # TODO Check is failing, for some reason the generated file does not contain | |
| # some of the indirect dependencies. | |
| # - name: Check THIRD_PARTY_NOTICES.md is up to date | |
| # run: | | |
| # go install go.elastic.co/go-licence-detector@v0.5.0 | |
| # make build-license-notice | |
| # if [ ! -z "$(git status --porcelain)" ]; then | |
| # git diff | |
| # exit 1 | |
| # fi | |
| codespell: | |
| name: Codespell | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Codespell test | |
| uses: codespell-project/actions-codespell@master | |
| with: | |
| skip: go.mod,go.sum |