diff --git a/.github/workflows/prometheus-rules.yml b/.github/workflows/prometheus-rules.yml index 29628e291..9638ed0bb 100644 --- a/.github/workflows/prometheus-rules.yml +++ b/.github/workflows/prometheus-rules.yml @@ -5,15 +5,21 @@ on: - main paths: - observability/prometheus/rules/**/*.y*ml + +env: + GO_VERSION: 1.19.1 + jobs: rules: runs-on: ubuntu-latest steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@v2 - name: Create Prometheus rule file run: | - export GOPATH=$HOME/go - export PATH=$PATH:$GOPATH/bin make install-tools cd observability/prometheus/ echo "# This file got auto-generated by GitHub workflow '$GITHUB_WORKFLOW'" > rule-file.yml @@ -31,8 +37,6 @@ jobs: yq eval-all --inplace --no-colors --prettyPrint "$append_rabbitmq_rules" rule-file.yml rules/rabbitmq/recording-rules.yml - name: Check Prometheus rule file run: | - export GOPATH=$HOME/go - export PATH=$PATH:$GOPATH/bin # need to use @main because of https://github.com/prometheus/prometheus/issues/8586#issuecomment-796976710 GO111MODULE=on go get github.com/prometheus/prometheus/cmd/promtool@main promtool check rules observability/prometheus/rule-file.yml