Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/.github/workflows/operator.yaml

127 lines
3.1 KiB

name: operator build
on:
push:
paths:
- 'operator/**'
branches: [ main ]
pull_request:
paths:
- 'operator/**'
jobs:
docs:
name: docs
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: ./operator/go.mod
- name: Check generated docs
working-directory: ./operator
run: |
make docs/operator/api.md docs/operator/feature-gates.md
git diff --exit-code
lint:
name: lint
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: ./operator/go.mod
- name: Lint
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7
with:
version: v2.0.2
args: --timeout=5m
working-directory: ./operator
- name: Check prometheus rules
working-directory: ./operator
run: make lint-prometheus
build-manager:
name: Build Manager
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: ./operator/go.mod
id: go
- name: Build Manager
working-directory: ./operator
run: |-
make manager && git diff --exit-code
build-broker:
name: Build Broker
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: ./operator/go.mod
- name: Build Broker
working-directory: ./operator
run: |-
make bin/loki-broker && git diff --exit-code
test:
name: test
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: ./operator/go.mod
- name: Run tests
working-directory: ./operator
run: go test -coverprofile=profile.cov ./...
- name: Run prometheus rule tests
working-directory: ./operator
run: make test-unit-prometheus
- name: Send coverage
uses: shogo82148/actions-goveralls@e6875f831db61e6abffbd8df91a2eb6cd24b46c9 # v1
with:
working-directory: ./operator
path-to-profile: profile.cov
flag-name: Go-1.23
shallow: true