Skip to content

Workflow: Clone and build grafana #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 17, 2023
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
47 changes: 47 additions & 0 deletions .github/workflows/check-grafana-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Checks if the current update to go.mod is compatible with Grafana.

name: Detect breaking change with Grafana

on:
pull_request:
paths:
- 'go.mod'
- 'go.sum'
branches:
- 'main'

jobs:
buildPR:
name: Build PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: './grafana-plugin-sdk-go'
- uses: actions/checkout@v4
with:
repository: 'grafana/grafana'
path: './grafana'
- uses: actions/setup-go@v4
with:
go-version-file: 'grafana-plugin-sdk-go/go.mod'

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

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

- name: Build Grafana
working-directory: './grafana'
run: make build-go
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
go.opentelemetry.io/otel/sdk v1.20.0
go.opentelemetry.io/otel/trace v1.20.0
golang.org/x/net v0.17.0
golang.org/x/oauth2 v0.11.0
golang.org/x/oauth2 v0.12.0
Copy link
Member

Choose a reason for hiding this comment

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

Is this change required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, this was just for triggering the workflow (it only executes if there are changes to go.mod) but thought of keeping it so we can move the updates and see this being triggered in other PRs.

golang.org/x/text v0.13.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down