Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
build: fix linter (#12)
Browse files Browse the repository at this point in the history
After a lot of debugging I noticed that the `envstub` call wasn't
working properly (couldn't figure out why), replaced for an action that
does the same thing.

Also disable `strict` mode, since now we have warnings.
  • Loading branch information
eh-am authored Mar 21, 2023
1 parent c032280 commit 19a5858
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
11 changes: 8 additions & 3 deletions .github/actions/lint-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ inputs:
runs:
using: "composite"
steps:
- name: Render Deployment YAML
uses: nowactions/envsubst@v1
with:
input: ./lint.config.yaml.tmpl
output: ./lint.config.yaml
env:
ENABLE_VERSION_ANALYZER: ${{ inputs.enable-version-analyzer }}
- name: Lint plugin
shell: bash
run: |
export PATH="$(go env GOPATH)/bin/:$PATH"
envsubst < lint.config.yaml > lint.config.yaml
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -strict -config lint.config.yaml -sourceCodeUri=file://./ ${{ inputs.file }}
plugincheck2 -config lint.config.yaml -sourceCodeUri=file://./ ${{ inputs.file }}
env:
ENABLE_VERSION_ANALYZER: ${{ inputs.enable-version-analyzer }}
DEBUG: 1

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node/
- run: yarn sign
- uses: ./.github/actions/package-plugin/
id: package-plugin
with:
grafana-token: ${{ secrets.GRAFANA_API_KEY }}
- uses: ./.github/actions/lint-plugin/
with:
file: ${{ steps.package-plugin.outputs.archive }}
# in PRs the version won't be correct, so there's no point checking it
enable-version-analyzer: false
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node/
- run: yarn sign
- uses: ./.github/actions/package-plugin/
id: package-plugin
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Releasing new versions
1. Merge the PR created by `Release Please`
2. Open [https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel](https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-datasource) and submit the plugin, copying the links from this repository's releases.
2. Open [https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel](https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel) and submit the plugin, copying the links from this repository's releases.

## Fixing releases
After submitting to Grafana, they may find issues.
Expand Down
8 changes: 0 additions & 8 deletions lint.config.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions lint.config.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
global:
enabled: true
jsonOutput: false
reportAll: false

analyzers:
version:
enabled: ${ENABLE_VERSION_ANALYZER}
trackingscripts:
# there's a false positive happening
# TODO: update after https://github.com/grafana/plugin-validator/issues/105 is fixed
enabled: false

0 comments on commit 19a5858

Please sign in to comment.