Skip to content

Commit

Permalink
Merge pull request #1144 from rabbitmq/version-go-in-prom-tests
Browse files Browse the repository at this point in the history
Explicitly install a known golang version.
  • Loading branch information
ChunyiLyu authored Sep 22, 2022
2 parents 7c20c4f + 0918e6d commit 8f21ba0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/prometheus-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f21ba0

Please sign in to comment.