Skip to content

Commit

Permalink
Update workflows and Prometheus annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Oct 26, 2024
1 parent 314db7b commit 237e690
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 95 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/python-ci.yml → .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Go CI
name: CI

concurrency: ci-${{ github.ref }}

on:
push:
branches: [develop]
paths:
- "src/**"
- "**/*.go"
- go.mod
- go.sum
- .go-version
workflow_dispatch:

jobs:
Expand All @@ -19,13 +22,23 @@ jobs:
include:
- {
name: Linux,
python: "1.23",
os: ubuntu-latest,
}
steps:
- uses: actions/checkout@v4
- name: tests
run: echo "TODO"
- name: Get swift version
id: get_lang_version
run: |
v=$(cat .go-version)
echo "go_version=$v" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ steps.get_lang_version.outputs.go_version }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...

# docs:
# needs: [tests]
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/go-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR

concurrency: pr-${{ github.ref }}

on:
pull_request:
branches: [develop]
paths:
- "**/*.go"
- go.mod
- go.sum
- .go-version

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {
name: Linux,
os: ubuntu-latest,
}
steps:
- uses: actions/checkout@v4
- name: Get swift version
id: get_lang_version
run: |
v=$(cat .go-version)
echo "go_version=$v" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ steps.get_lang_version.outputs.go_version }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
52 changes: 0 additions & 52 deletions .github/workflows/python-pr.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/python-update-reqs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/catalog-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func main() {
tracing.SetupTracing()
defer tracing.TeardownTracing()

// get global Monitor object
// Setup Prometheus metrics
m := ginmetrics.GetMonitor()
m.SetMetricPath("/metrics")
m.SetSlowTime(10)
Expand Down
4 changes: 4 additions & 0 deletions kubernetes/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ spec:
package: catalog
component: api
version: v1
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: '/metrics'
prometheus.io/port: '8000'
spec:
serviceAccountName: api
imagePullSecrets:
Expand Down

0 comments on commit 237e690

Please sign in to comment.