-
Notifications
You must be signed in to change notification settings - Fork 66
53 lines (46 loc) · 1.34 KB
/
check-grafana-compatibility.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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@v5
with:
cache: false
go-version: '~1.22'
check-latest: true
- 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: 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
- name: Build Grafana
working-directory: './grafana'
run: make build-go