fix(deps): update module github.com/prometheus/client_golang to v1.21.0 #1556
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: Push/PR pipeline | |
on: | |
push: | |
branches: | |
- main | |
- renovate/** | |
pull_request: | |
env: | |
TAG: "v0.0.0" # needed for goreleaser windows builds | |
REPO_FULL_NAME: ${{ github.event.repository.full_name }} | |
ORIGINAL_REPO_NAME: "newrelic/nri-prometheus" | |
DOCKER_LOGIN_AVAILABLE: ${{ secrets.OHAI_DOCKER_HUB_ID }} | |
jobs: | |
chart-lint: | |
name: Helm chart Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
kubernetes-version: [ "v1.25.6", "v1.26.0" ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: helm/chart-testing-action@v2.7.0 | |
- 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/actions-setup-minikube@v2.13.1 | |
if: steps.list-changed.outputs.changed == 'true' | |
with: | |
minikube version: v1.33.1 | |
driver: docker | |
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: | | |
export TAG=test | |
export GOOS=linux | |
export GOARCH=amd64 | |
make ci/build | |
# Find the highest versioned amd64 build directory | |
# Sort numerically on the version suffix (e.g., _v1, _v2) | |
latest_dir=$(ls -d ./dist/nri-prometheus-nix_linux_amd64* | sort -V | tail -n1) | |
if [ -z "$latest_dir" ]; then | |
echo "Error: No matching build directory found" | |
exit 1 | |
fi | |
sudo cp "${latest_dir}/nri-prometheus" ./bin/nri-prometheus | |
DOCKER_BUILDKIT=1 docker build -t e2e/nri-prometheus:test . -f Dockerfile.dev | |
minikube image load e2e/nri-prometheus:test | |
- name: Test install charts | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --config .github/ct.yaml --debug | |
- name: Test upgrade charts | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --config .github/ct.yaml --debug --upgrade | |
static-analysis: | |
name: Run all static analysis checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- uses: newrelic/newrelic-infra-checkers@v1 | |
with: | |
golangci-lint-config: golangci-lint-limited | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
continue-on-error: ${{ github.event_name != 'pull_request' }} | |
with: | |
only-new-issues: true | |
version: v1.63 | |
- name: Check if CHANGELOG is valid | |
uses: newrelic/release-toolkit/validate-markdown@v1 | |
test-nix: | |
name: Run unit tests on *Nix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Unit tests | |
run: make ci/test | |
test-windows: | |
name: Run unit tests on Windows | |
runs-on: windows-latest | |
env: | |
GOPATH: ${{ github.workspace }} | |
defaults: | |
run: | |
working-directory: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'src/github.com/${{ env.ORIGINAL_REPO_NAME }}/go.mod' | |
- name: Running unit tests | |
shell: pwsh | |
run: | | |
.\build\windows\unit_tests.ps1 | |
# make sure code build in all platforms | |
build: | |
name: Build binary for all platforms:arch | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build all platforms:arch | |
run: make ci/build | |
- name: Check if CHANGELOG is valid | |
uses: newrelic/release-toolkit/validate-markdown@v1 |