Skip to content

Commit 11961e1

Browse files
committed
split the flow
1 parent 19feb31 commit 11961e1

File tree

2 files changed

+116
-75
lines changed

2 files changed

+116
-75
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,10 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
resolve-versions:
19-
name: Resolve Grafana images
18+
run:
2019
runs-on: ubuntu-latest
21-
timeout-minutes: 3
22-
outputs:
23-
matrix: ${{ steps.resolve-versions.outputs.matrix }}
24-
steps:
25-
- name: Checkout
26-
uses: actions/checkout@v4
27-
- name: Resolve Grafana E2E versions
28-
id: resolve-versions
29-
uses: grafana/plugin-actions/e2e-version@main
30-
31-
build:
32-
needs: resolve-versions
3320
timeout-minutes: 15
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
GRAFANA_IMAGE: ${{fromJson(needs.resolve-versions.outputs.matrix)}}
38-
name: e2e ${{ matrix.GRAFANA_IMAGE.name }}@${{ matrix.GRAFANA_IMAGE.VERSION }}
39-
runs-on: ubuntu-latest
21+
name: CI
4022
env:
4123
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
4224
steps:
@@ -79,61 +61,7 @@ jobs:
7961
uses: magefile/mage-action@v3
8062
with:
8163
version: latest
82-
args: build:linux
83-
# args: buildAll # do we want to build all?
84-
85-
- name: Start Grafana
86-
run: |
87-
docker-compose pull
88-
GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
89-
90-
- name: Wait for prometheus to start
91-
uses: nev7n/wait_for_response@v1
92-
with:
93-
url: 'http://localhost:9090/-/ready'
94-
responseCode: 200
95-
timeout: 20000
96-
interval: 500
97-
98-
- name: Wait for Grafana to start
99-
uses: nev7n/wait_for_response@v1
100-
with:
101-
url: 'http://localhost:3000/'
102-
responseCode: 200
103-
timeout: 60000
104-
interval: 500
105-
106-
- name: Install Playwright Browsers
107-
run: yarn playwright install --with-deps
108-
109-
- name: Run Playwright tests
110-
id: run-tests
111-
run: yarn e2e
112-
113-
- name: Upload playwright artifacts
114-
uses: actions/upload-artifact@v4
115-
if: ${{ github.repository_owner != 'grafana' && (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
116-
with:
117-
name: playwright-report-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
118-
path: playwright-report/
119-
retention-days: 30
120-
121-
- name: Upload playwright videos
122-
uses: actions/upload-artifact@v4
123-
if: ${{ github.repository_owner != 'grafana' && (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
124-
with:
125-
name: test-results-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
126-
path: test-results/
127-
retention-days: 30
128-
129-
# - name: Publish report to GCS
130-
# if: ${{ github.repository_owner == 'grafana' && (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
131-
# uses: grafana/plugin-actions/publish-report@main
132-
# with:
133-
# grafana-version: ${{ matrix.GRAFANA_IMAGE.VERSION }}
134-
135-
- name: Stop grafana docker
136-
run: docker-compose down
64+
args: buildAll
13765

13866
- name: Sign plugin
13967
run: yarn sign

.github/workflows/e2e.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: e2e
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions: read-all
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
resolve-versions:
19+
name: Resolve Grafana images
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 3
22+
outputs:
23+
matrix: ${{ steps.resolve-versions.outputs.matrix }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Resolve Grafana E2E versions
28+
id: resolve-versions
29+
uses: grafana/plugin-actions/e2e-version@main
30+
31+
run-e2e:
32+
needs: resolve-versions
33+
timeout-minutes: 15
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
GRAFANA_IMAGE: ${{fromJson(needs.resolve-versions.outputs.matrix)}}
38+
name: e2e ${{ matrix.GRAFANA_IMAGE.name }}@${{ matrix.GRAFANA_IMAGE.VERSION }}
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Node.js environment
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version-file: .nvmrc
47+
cache: 'yarn'
48+
49+
- name: Install dependencies
50+
run: yarn install
51+
52+
- name: Build frontend
53+
run: yarn build
54+
55+
- name: Setup Go environment
56+
uses: actions/setup-go@v5
57+
with:
58+
go-version-file: './go.mod'
59+
cache-dependency-path: "**/*.sum"
60+
61+
- name: Build backend [linux]
62+
uses: magefile/mage-action@v3
63+
with:
64+
version: latest
65+
args: build:linux
66+
# args: buildAll # do we want to build all?
67+
68+
- name: Start Grafana
69+
run: |
70+
docker-compose pull
71+
GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
72+
73+
- name: Wait for prometheus to start
74+
uses: nev7n/wait_for_response@v1
75+
with:
76+
url: 'http://localhost:9090/-/ready'
77+
responseCode: 200
78+
timeout: 20000
79+
interval: 500
80+
81+
- name: Wait for Grafana to start
82+
uses: nev7n/wait_for_response@v1
83+
with:
84+
url: 'http://localhost:3000/'
85+
responseCode: 200
86+
timeout: 60000
87+
interval: 500
88+
89+
- name: Install Playwright Browsers
90+
run: yarn playwright install --with-deps
91+
92+
- name: Run Playwright tests
93+
id: run-tests
94+
run: yarn e2e
95+
96+
- name: Upload playwright artifacts
97+
uses: actions/upload-artifact@v4
98+
if: ${{ github.repository_owner != 'grafana' && (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
99+
with:
100+
name: playwright-report-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
101+
path: playwright-report/
102+
retention-days: 30
103+
104+
- name: Upload playwright videos
105+
uses: actions/upload-artifact@v4
106+
if: ${{ github.repository_owner != 'grafana' && (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
107+
with:
108+
name: test-results-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}}
109+
path: test-results/
110+
retention-days: 30
111+
112+
- name: Stop grafana docker
113+
run: docker-compose down

0 commit comments

Comments
 (0)