@grafana/create-plugin 4.6.1 → 4.7.0-canary.870.6afd6d2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "4.6.1",
3
+ "version": "4.7.0-canary.870.6afd6d2.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -87,5 +87,5 @@
87
87
  "engines": {
88
88
  "node": ">=20"
89
89
  },
90
- "gitHead": "0714011b348b73514ba25e021c130847d576ee8e"
90
+ "gitHead": "6afd6d2acd3d177b308eb692a5a52b93a3c8fc1c"
91
91
  }
@@ -15,7 +15,13 @@ permissions: read-all
15
15
 
16
16
  jobs:
17
17
  build:
18
+ name: Build, lint and unit tests
18
19
  runs-on: ubuntu-latest
20
+ outputs:
21
+ plugin-id: $\{{ steps.metadata.outputs.plugin-id }}
22
+ plugin-version: $\{{ steps.metadata.outputs.plugin-version }}
23
+ has-e2e: $\{{ steps.check-for-e2e.outputs.has-e2e }}
24
+ has-backend: $\{{ steps.check-for-backend.outputs.has-backend }}
19
25
  env:
20
26
  GRAFANA_ACCESS_POLICY_TOKEN: $\{{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
21
27
  steps:
@@ -79,40 +85,6 @@ jobs:
79
85
  echo "has-e2e=true" >> $GITHUB_OUTPUT
80
86
  fi
81
87
 
82
- - name: Install Playwright Browsers
83
- if: steps.check-for-e2e.outputs.has-e2e == 'true'
84
- run: {{ packageManagerName }} exec playwright install --with-deps
85
-
86
- - name: Start grafana docker
87
- if: steps.check-for-e2e.outputs.has-e2e == 'true'
88
- run: docker-compose up -d
89
-
90
- - name: Wait for Grafana to start
91
- if: steps.check-for-e2e.outputs.has-e2e == 'true'
92
- uses: nev7n/wait_for_response@v1
93
- with:
94
- url: 'http://localhost:3000/'
95
- responseCode: 200
96
- timeout: 60000
97
- interval: 500
98
-
99
- - name: Run e2e tests
100
- id: run-e2e-tests
101
- if: steps.check-for-e2e.outputs.has-e2e == 'true'
102
- run: {{ packageManagerName }} run e2e
103
-
104
- - name: Stop grafana docker
105
- if: steps.check-for-e2e.outputs.has-e2e == 'true'
106
- run: docker-compose down
107
-
108
- - name: Archive E2E output
109
- uses: actions/upload-artifact@v4
110
- if: steps.check-for-e2e.outputs.has-e2e == 'true' && steps.run-e2e-tests.outcome != 'success'
111
- with:
112
- name: playwright-report
113
- path: playwright-report/
114
- retention-days: 5
115
-
116
88
  - name: Sign plugin
117
89
  run: {{ packageManagerName }} run sign
118
90
  if: $\{{ env.GRAFANA_ACCESS_POLICY_TOKEN != '' }}
@@ -142,3 +114,107 @@ jobs:
142
114
  name: $\{{ steps.metadata.outputs.plugin-id }}-$\{{ steps.metadata.outputs.plugin-version }}
143
115
  path: $\{{ steps.metadata.outputs.plugin-id }}
144
116
  retention-days: 5
117
+
118
+ resolve-versions:
119
+ name: Resolve e2e images
120
+ runs-on: ubuntu-latest
121
+ timeout-minutes: 3
122
+ needs: build
123
+ if: $\{{ needs.build.outputs.has-e2e == 'true' }}
124
+ outputs:
125
+ matrix: $\{{ steps.resolve-versions.outputs.matrix }}
126
+ steps:
127
+ - name: Checkout
128
+ uses: actions/checkout@v4
129
+ - name: Resolve Grafana E2E versions
130
+ id: resolve-versions
131
+ uses: grafana/plugin-actions/e2e-version@main
132
+
133
+ playwright-tests:
134
+ needs: [resolve-versions, build]
135
+ timeout-minutes: 15
136
+ strategy:
137
+ fail-fast: false
138
+ matrix:
139
+ GRAFANA_IMAGE: $\{{fromJson(needs.resolve-versions.outputs.matrix)}}
140
+ name: e2e test $\{{ matrix.GRAFANA_IMAGE.name }}@$\{{ matrix.GRAFANA_IMAGE.VERSION }}
141
+ runs-on: ubuntu-latest
142
+ steps:
143
+ - uses: actions/checkout@v4
144
+ with:
145
+ sparse-checkout: |
146
+ provisioning
147
+ tests
148
+ .config
149
+
150
+ - name: Download plugin
151
+ if: needs.build.outputs.has-backend == 'true'
152
+ uses: actions/download-artifact@v4
153
+ with:
154
+ path: dist
155
+ name: $\{{ needs.build.outputs.plugin-id }}-$\{{ needs.build.outputs.plugin-version }}
156
+
157
+ - name: Execute permissions on binary
158
+ if: needs.build.outputs.has-backend == 'true'
159
+ run: |
160
+ chmod +x ./dist/gpx_cicd_linux_amd64
161
+
162
+ {{#if_eq packageManagerName "pnpm"}}
163
+ # pnpm action uses the packageManager field in package.json to
164
+ # understand which version to install.
165
+ - uses: pnpm/action-setup@v3
166
+ {{/if_eq}}
167
+ - name: Setup Node.js environment
168
+ uses: actions/setup-node@v4
169
+ with:
170
+ node-version: '20'
171
+ cache: '{{ packageManagerName }}'
172
+
173
+ - name: Install dev dependencies
174
+ run: {{ packageManagerInstallCmd }}
175
+
176
+ - name: Start Grafana
177
+ run: |
178
+ docker-compose pull
179
+ GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
180
+
181
+ - name: Wait for Grafana to start
182
+ uses: nev7n/wait_for_response@v1
183
+ with:
184
+ url: 'http://localhost:3000/'
185
+ responseCode: 200
186
+ timeout: 60000
187
+ interval: 500
188
+
189
+ - name: Install Playwright Browsers
190
+ run: npx playwright install chromium --with-deps
191
+
192
+ - name: Run Playwright tests
193
+ id: run-tests
194
+ run: {{ packageManagerName }} run e2e
195
+
196
+ - name: Docker logs
197
+ if: $\{{ always() && steps.run-tests.outcome == 'failure' }}
198
+ run: |
199
+ docker logs {{ pluginId }} >& grafana-server.log
200
+
201
+ - name: Stop grafana docker
202
+ run: docker-compose down
203
+
204
+ - name: Upload server log
205
+ uses: actions/upload-artifact@v4
206
+ if: $\{{ always() && steps.run-tests.outcome == 'failure' }}
207
+ with:
208
+ name: $\{{ matrix.GRAFANA_IMAGE.NAME }}-v$\{{ matrix.GRAFANA_IMAGE.VERSION }}-$\{{github.run_id}}-server-log
209
+ path: grafana-server.log
210
+ retention-days: 5
211
+
212
+ # If your repository is public, uploading the Playwright report will make it public on the Internet.
213
+ # Beware not to expose sensitive information.
214
+ - name: Upload artifacts
215
+ uses: actions/upload-artifact@v4
216
+ if: $\{{ always() && steps.run-tests.outcome == 'failure' }}
217
+ with:
218
+ name: playwright-report-$\{{ matrix.GRAFANA_IMAGE.NAME }}-v$\{{ matrix.GRAFANA_IMAGE.VERSION }}-$\{{github.run_id}}
219
+ path: playwright-report/
220
+ retention-days: 5