|
6 | 6 | concurrency:
|
7 | 7 | group: integration-tests-${{ github.ref }}
|
8 | 8 | cancel-in-progress: true
|
| 9 | + |
9 | 10 | permissions:
|
10 |
| - contents: write |
11 |
| - id-token: write |
12 |
| - pull-requests: write |
| 11 | + contents: read |
13 | 12 |
|
14 | 13 | jobs:
|
15 | 14 | setup-matrix:
|
|
23 | 22 | steps:
|
24 | 23 | - name: Checkout
|
25 | 24 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
| 25 | + with: |
| 26 | + persist-credentials: false |
26 | 27 | - name: Setup plugin dir variable
|
27 | 28 | id: set-plugin-dirs
|
28 | 29 | run: echo "pluginDirs=$(find ./examples -type d -name "src" -not -path "*/node_modules*" -maxdepth 3 -exec test -e "{}/plugin.json" \; -print | sed "s/\/src$//" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
|
@@ -58,11 +59,15 @@ jobs:
|
58 | 59 | GF_INSTALL_PLUGINS: "marcusolsson-static-datasource"
|
59 | 60 | steps:
|
60 | 61 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
| 62 | + with: |
| 63 | + persist-credentials: false |
61 | 64 |
|
62 | 65 | - name: Set the name of the plugin-example to be tested
|
63 | 66 | id: example-name
|
64 | 67 | run: |
|
65 |
| - echo "PLUGIN_NAME=$(basename ${{ matrix.pluginDir }})" >> $GITHUB_OUTPUT |
| 68 | + echo "PLUGIN_NAME=$(basename $PLUGIN_NAME)" >> $GITHUB_OUTPUT |
| 69 | + env: |
| 70 | + PLUGIN_NAME: ${{ matrix.pluginDir }} |
66 | 71 |
|
67 | 72 | - name: Setup node version
|
68 | 73 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
|
@@ -120,13 +125,17 @@ jobs:
|
120 | 125 | run: |
|
121 | 126 | echo "PLUGIN_ID=$(cat src/plugin.json | jq -r '.id')" >> $GITHUB_ENV
|
122 | 127 | echo "EXPECTED_GRAFANA_VERSION=$(npx semver@latest $(cat src/plugin.json | jq -r '.dependencies.grafanaDependency') -c)" >> $GITHUB_ENV
|
123 |
| - echo "CANARY_VERSION=${{ needs.setup-matrix.outputs.canaryVersion }}" >> $GITHUB_ENV |
124 |
| - echo "CANARY_DOCKER_TAG=${{ needs.setup-matrix.outputs.canaryDockerTag }}" >> $GITHUB_ENV |
125 |
| - echo "LATEST_STABLE_VERSION=${{ needs.setup-matrix.outputs.latestVersion }}" >> $GITHUB_ENV |
| 128 | + echo "CANARY_VERSION=$CANARY_VERSION" >> $GITHUB_ENV |
| 129 | + echo "CANARY_DOCKER_TAG=$CANARY_DOCKER_TAG" >> $GITHUB_ENV |
| 130 | + echo "LATEST_STABLE_VERSION=$LATEST_STABLE_VERSION" >> $GITHUB_ENV |
126 | 131 | if [ -f "${PWD}/.env" ]; then
|
127 | 132 | echo "ENV_FILE_OPTION=--env-file ${PWD}/.env" >> $GITHUB_ENV
|
128 | 133 | fi
|
129 | 134 | working-directory: ${{ matrix.pluginDir }}
|
| 135 | + env: |
| 136 | + CANARY_VERSION: ${{ needs.setup-matrix.outputs.canaryVersion }} |
| 137 | + CANARY_DOCKER_TAG: ${{ needs.setup-matrix.outputs.canaryDockerTag }} |
| 138 | + LATEST_STABLE_VERSION: ${{ needs.setup-matrix.outputs.latestVersion }} |
130 | 139 |
|
131 | 140 | - name: Has Integration Tests
|
132 | 141 | id: has-integration-tests
|
@@ -184,10 +193,12 @@ jobs:
|
184 | 193 | if: steps.has-integration-tests.outputs.DIR == 'true' && steps.should-run-expected-latest-tests.outcome == 'success'
|
185 | 194 | id: expected-version-tests
|
186 | 195 | continue-on-error: true
|
187 |
| - run: npm run e2e --prefix ${{ matrix.pluginDir }} |
| 196 | + run: npm run e2e --prefix $PLUGIN_DIR |
| 197 | + env: |
| 198 | + PLUGIN_DIR: ${{ matrix.pluginDir }} |
188 | 199 |
|
189 | 200 | - name: Expected - Upload e2e test summary
|
190 |
| - uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main |
| 201 | + uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main # zizmor: ignore[unpinned-uses] |
191 | 202 | if: ${{ always() && steps.expected-version-tests.outcome == 'failure' }}
|
192 | 203 | with:
|
193 | 204 | report-dir: ${{ matrix.pluginDir }}/playwright-report
|
@@ -225,10 +236,12 @@ jobs:
|
225 | 236 | if: steps.has-integration-tests.outputs.DIR == 'true' && steps.should-run-expected-latest-tests.outcome == 'success'
|
226 | 237 | id: latest-version-tests
|
227 | 238 | continue-on-error: true
|
228 |
| - run: npm run e2e --prefix ${{ matrix.pluginDir }} |
| 239 | + run: npm run e2e --prefix $PLUGIN_DIR |
| 240 | + env: |
| 241 | + PLUGIN_DIR: ${{ matrix.pluginDir }} |
229 | 242 |
|
230 | 243 | - name: Latest - Upload e2e test summary
|
231 |
| - uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main |
| 244 | + uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main # zizmor: ignore[unpinned-uses] |
232 | 245 | if: ${{ always() && steps.latest-version-tests.outcome == 'failure' }}
|
233 | 246 | with:
|
234 | 247 | report-dir: ${{ matrix.pluginDir }}/playwright-report
|
@@ -291,10 +304,12 @@ jobs:
|
291 | 304 | if: steps.has-integration-tests.outputs.DIR == 'true'
|
292 | 305 | id: canary-version-tests
|
293 | 306 | continue-on-error: true
|
294 |
| - run: npm run e2e --prefix ${{ matrix.pluginDir }} |
| 307 | + run: npm run e2e --prefix $PLUGIN_DIR |
| 308 | + env: |
| 309 | + PLUGIN_DIR: ${{ matrix.pluginDir }} |
295 | 310 |
|
296 | 311 | - name: Canary - Upload e2e test summary
|
297 |
| - uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main |
| 312 | + uses: grafana/plugin-actions/playwright-gh-pages/upload-report-artifacts@main # zizmor: ignore[unpinned-uses] |
298 | 313 | if: ${{ always() && steps.canary-version-tests.outcome == 'failure' }}
|
299 | 314 | with:
|
300 | 315 | report-dir: ${{ matrix.pluginDir }}/playwright-report
|
@@ -322,21 +337,28 @@ jobs:
|
322 | 337 | publish-report:
|
323 | 338 | if: ${{ always() }}
|
324 | 339 | needs: [run-integration-tests]
|
| 340 | + permissions: |
| 341 | + contents: write |
| 342 | + pull-requests: write |
325 | 343 | runs-on: ubuntu-latest
|
326 | 344 | steps:
|
327 | 345 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
| 346 | + with: |
| 347 | + persist-credentials: false |
328 | 348 | - name: Publish report
|
329 |
| - uses: grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@main |
| 349 | + uses: grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@main # zizmor: ignore[unpinned-uses] |
330 | 350 | with:
|
331 | 351 | github-token: ${{ secrets.GITHUB_TOKEN }}
|
332 | 352 |
|
333 | 353 | notify:
|
334 | 354 | if: ${{ (always() && github.event_name == 'schedule') }}
|
335 | 355 | runs-on: ubuntu-latest
|
336 | 356 | needs: [run-integration-tests]
|
| 357 | + permissions: |
| 358 | + id-token: write |
337 | 359 | steps:
|
338 | 360 | - id: get-secrets
|
339 |
| - uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.1.0 |
| 361 | + uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760 # get-vault-secrets-v1.1.0 |
340 | 362 | with:
|
341 | 363 | # Secrets placed in the ci/repo/grafana/grafana-plugin-examples path in Vault
|
342 | 364 | repo_secrets: |
|
@@ -397,7 +419,7 @@ jobs:
|
397 | 419 | },
|
398 | 420 | {
|
399 | 421 | "type": "mrkdwn",
|
400 |
| - "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github. run_id }}?pr=${{ github.event.number }}|See Playwright reports>" |
| 422 | + "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.number }}|See Playwright reports>" |
401 | 423 | }
|
402 | 424 | ]
|
403 | 425 | }
|
|
0 commit comments