Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: go
on:
push:
branches:
- main
- release-*
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }}

jobs:
download-plugin:
name: "download default plugins"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: perses/github-actions@a7d024e4d064be61d47b59bafd514d1465fb2e4d # v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_cue: false
- name: download plugin
run: make install-default-plugins
- name: store plugin to share with other jobs
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: plugins
path: |
plugins-archive
gofmt:
name: "check code format"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: perses/github-actions@a7d024e4d064be61d47b59bafd514d1465fb2e4d # v0.12.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_cue: true
cue_version: "v0.16.1"
go_version: "1.26.6"
- name: check format
run: make checkformat
- name: check go.mod
run: make checkunused
test-file:
name: "tests with file DB"
runs-on: ubuntu-latest
needs: "download-plugin"
services:
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
postgres:
image: postgres:17
ports:
- "5432:5432"
env:
POSTGRES_DB: perses
POSTGRES_USER: user
POSTGRES_PASSWORD: password
steps:
- name: checkout
uses: actions/checkout@v7
- uses: perses/github-actions@v0.13.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
enable_cue: true # needed for DaC CLI commands unit tests
cue_version: "v0.16.1"
- name: Download plugin archive
uses: actions/download-artifact@v8
with:
name: plugins
path: plugins-archive
- name: test
run: make integration-test
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,13 @@ validate-data:
@echo ">> Validate all data in dev/data"
$(GO) run ./scripts/validate-data/validate-data.go

.PHONY: go-sdk-test
go-sdk-test:
@echo ">> Run Perses Go SDK tests"
cd ./go-sdk/test && $(GO) test -v -count=1 ./...

.PHONY: test
test: generate
@echo ">> Run all tests"
$(GO) test -count=1 -v ./...

.PHONY: integration-test
integration-test: generate go-sdk-test
integration-test: generate
@echo ">> Run integration tests"
$(GO) test -tags=integration -v -count=1 -cover -coverprofile=$(COVER_PROFILE) -coverpkg=./... ./...

Expand Down
4 changes: 2 additions & 2 deletions cmd/perses/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"flag"

"github.com/perses/common/app"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/rhobs/perses/internal/api/core"
"github.com/rhobs/perses/internal/api/impl/v1/view"
"github.com/rhobs/perses/pkg/model/api/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/sirupsen/logrus"
)

Expand Down
6 changes: 3 additions & 3 deletions go-sdk/dashboard/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"fmt"
"time"

"github.com/perses/spec/go/common"
"github.com/perses/spec/go/dashboard"
datasourceSpec "github.com/perses/spec/go/datasource"
"github.com/rhobs/perses/go-sdk/datasource"
panelgroup "github.com/rhobs/perses/go-sdk/panel-group"
"github.com/rhobs/perses/go-sdk/variable"
variablegroup "github.com/rhobs/perses/go-sdk/variable-group"
"github.com/perses/spec/go/common"
"github.com/perses/spec/go/dashboard"
datasourceSpec "github.com/perses/spec/go/datasource"
)

type GridItem struct {
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/panel/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
package panel

import (
"github.com/rhobs/perses/go-sdk/link"
"github.com/rhobs/perses/go-sdk/query"
"github.com/perses/spec/go/common"
"github.com/perses/spec/go/dashboard"
"github.com/rhobs/perses/go-sdk/link"
"github.com/rhobs/perses/go-sdk/query"
)

func Title(title string) Option {
Expand Down
2 changes: 1 addition & 1 deletion go-sdk/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package query
import (
"fmt"

"github.com/rhobs/perses/pkg/model/api/v1/plugin"
"github.com/perses/spec/go/common"
"github.com/perses/spec/go/dashboard"
"github.com/rhobs/perses/pkg/model/api/v1/plugin"
)

type Option struct {
Expand Down
104 changes: 0 additions & 104 deletions go-sdk/test/dashboard.go

This file was deleted.

Loading
Loading