diff --git a/.github/workflows/release-rmf-app-grafana.yml b/.github/workflows/rmf-app-grafana.yml similarity index 78% rename from .github/workflows/release-rmf-app-grafana.yml rename to .github/workflows/rmf-app-grafana.yml index e303ead..0b1830b 100644 --- a/.github/workflows/release-rmf-app-grafana.yml +++ b/.github/workflows/rmf-app-grafana.yml @@ -1,9 +1,16 @@ -name: Release Grafana RMF App +name: grafana-rmf-app on: push: + branches: + - 'staging/v*' + - 'release/v*' tags: - - ibm-rmf-grafana/v* + - 'ibm-rmf-grafana/v*' + pull_request: + branches: + - 'staging/v*' + - 'release/v*' jobs: build: @@ -18,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: grafana/rmf-app/.nvmrc cache: 'yarn' @@ -30,6 +37,16 @@ jobs: go-version-file: grafana/rmf-app/go.mod cache-dependency-path: grafana/rmf-app/go.sum + - name: Test unittests + run: make test + + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.58 + only-new-issues: true + working-directory: grafana/rmf-app + - name: Build run: make all @@ -49,6 +66,7 @@ jobs: sign: runs-on: code-sign needs: build + if: startsWith(github.ref, 'refs/tags/ibm-rmf-grafana/v') steps: - name: Download Build @@ -74,6 +92,7 @@ jobs: release: runs-on: ubuntu-latest needs: sign + if: startsWith(github.ref, 'refs/tags/ibm-rmf-grafana/v') steps: - name: Download Build diff --git a/grafana/rmf-app/CHANGELOG.md b/grafana/rmf-app/CHANGELOG.md index 408e5d1..af32fea 100644 --- a/grafana/rmf-app/CHANGELOG.md +++ b/grafana/rmf-app/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 1.0.4 (xxxx-xx-xx) + +TBD + ## 1.0.3 (2024-02-29) - Time-series dashboards plot graphs correctly even when NaN values are in the historical data. diff --git a/grafana/rmf-app/makefile b/grafana/rmf-app/makefile index b378b0a..a8d6d6d 100644 --- a/grafana/rmf-app/makefile +++ b/grafana/rmf-app/makefile @@ -30,7 +30,7 @@ dev-frontend: deps-frontend ## Build frontend data sources (development) watch-frontend: deps-frontend ## Auto rebuilt frontend on file changes yarn run watch -dev-backend: deps-backend # Build backend data sources (development) +dev-backend: deps-backend ## Build backend data sources (development) go build -race -o ./dist/datasources/redisrmf-datasource/gpx_ibm-rmf-datasource_$$(go env GOOS)_$$(go env GOARCH) -tags netgo -ldflags -w ./pkg restart-backend: ## Rebuild and restart backend data source (as root) @@ -57,6 +57,12 @@ build-backend: deps-backend ## Build backend data source copy-config: #copy the rmf-plugin-config.yml to executable path cp ./pkg/plugin/rmf-plugin-config.yml ./dist/datasources/rmf-datasource/ +test: deps-backend ## Run unittests + go test -v ./... + +lint: ## Run linters + golangci-lint run + build: build-frontend build-backend copy-config ## Build everything zip: ## Zip the plugin