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
72 changes: 34 additions & 38 deletions .github/workflows/check-grafana-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Detect breaking change with Grafana
on:
pull_request:
paths:
- 'go.mod'
- 'go.sum'
- "go.mod"
- "go.sum"
branches:
- 'main'
- "main"

jobs:
buildPR:
Expand All @@ -17,41 +17,37 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
path: './grafana-plugin-sdk-go'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
repository: 'grafana/grafana'
path: './grafana'
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
with:
cache: false
go-version: '~1.22'
check-latest: true
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
path: "./grafana-plugin-sdk-go"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
repository: "grafana/grafana"
path: "./grafana"
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
with:
cache: false
go-version: "~1.22"
check-latest: true

- name: Check if branch exists in Grafana
working-directory: './grafana'
env:
BRANCH: ${{ github.head_ref }}
run: |
if git ls-remote --heads --quiet --exit-code origin "$BRANCH"; then
echo "Found branch $BRANCH in Grafana"
git fetch origin "$BRANCH" && git checkout "$BRANCH"
else
echo "Branch $BRANCH not found in Grafana"
fi
- name: Check if branch exists in Grafana
working-directory: "./grafana"
env:
BRANCH: ${{ github.head_ref }}
run: |
if git ls-remote --heads --quiet --exit-code origin "$BRANCH"; then
echo "Found branch $BRANCH in Grafana"
git fetch origin "$BRANCH" && git checkout "$BRANCH"
else
echo "Branch $BRANCH not found in Grafana"
fi

- name: Link sdk
working-directory: './grafana'
run: go mod edit -replace github.com/grafana/grafana-plugin-sdk-go=../grafana-plugin-sdk-go
- name: Link sdk
working-directory: "./grafana"
run: go mod edit -replace github.com/grafana/grafana-plugin-sdk-go=../grafana-plugin-sdk-go

- name: Automatic updates
working-directory: './grafana'
run: go mod tidy
Comment on lines -51 to -53
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR: This step is not needed because the build-go make target runs go mod tidy nowadays


- name: Build Grafana
working-directory: './grafana'
run: make build-go
- name: Build Grafana
working-directory: "./grafana"
run: make build-go
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
permissions:
contents: read

env:
GOLANGCI_LINT_VERSION: v1.64.2

jobs:
lint-build-test:
name: Lint, Build, and Test
Expand All @@ -30,7 +27,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
with:
version: ${GOLANGCI_LINT_VERSION}
version: v1.64.2
args: |
"./..." --timeout=7m
skip-cache: true
Expand Down