Skip to content

Commit a5394ac

Browse files
committed
Migration V
* Update github actions
1 parent 321e475 commit a5394ac

19 files changed

+188
-221
lines changed

.github/build/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
- name: Install dependencies
2020
shell: bash
2121
run: |
22-
yarn install --frozen-lockfile
22+
npm ci
2323
sudo apt-get install jq
2424
2525
- name: Adapt version of plugin to indicate this is not a official release
@@ -46,16 +46,16 @@ runs:
4646
- name: Build signed plugin and test frontend
4747
shell: bash
4848
run: |
49-
# yarn build script will adapt src/plugin.json via utils/plugin_json*.sh
50-
yarn run build:cloud
51-
yarn run sign
49+
# npm run build script will adapt src/plugin.json via utils/plugin_json*.sh
50+
npm run build:cloud
51+
npm run sign
5252
if: ${{ inputs.signed == 'true'}}
5353

5454
- name: Build unsigned plugin and test frontend
5555
shell: bash
5656
run: |
57-
# yarn build script will adapt src/plugin.json via utils/plugin_json*.sh
58-
yarn run build
57+
# npm run build script will adapt src/plugin.json via utils/plugin_json*.sh
58+
npm run build
5959
if: ${{ inputs.signed == 'false' }}
6060

6161
- name: Get plugin metadata

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ jobs:
3737
- uses: actions/checkout@v4
3838

3939
- name: Setup Node.js environment
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20'
43-
cache: 'yarn'
43+
cache: 'npm'
4444

4545
- name: Install dependencies
46-
run: yarn install --immutable --prefer-offline
46+
run: npm ci --prefer-offline
4747

4848
- name: Run prettier
49-
run: yarn prettier -c '{**/*,*}.{js,ts,jsx,tsx,json,yml}'
49+
run: npm run pretty:check
5050

5151
- name: Check types
52-
run: yarn typecheck
52+
run: npm run typecheck
53+
5354
- name: Lint
54-
run: yarn lint
55+
run: npm run lint
56+
5557
- name: Unit tests
56-
run: yarn test:ci
58+
run: npm run test:ci
5759

5860
- name: Compatibility check
5961
run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/ui,@grafana/runtime

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
- uses: actions/checkout@v4
1212

1313
- name: Setup Node.js environment
14-
uses: actions/setup-node@v3
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: '16'
17-
cache: 'yarn'
16+
node-version: '20'
17+
cache: 'npm'
1818

1919
- name: build signed
2020
id: build-signed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ playwright/.auth/
3636
.idea
3737
.vscode
3838

39-
# Editor
40-
.idea
41-
.vscode
39+
# Local data
40+
.env
41+
local/
4242

4343
.eslintcache

package-lock.json

Lines changed: 47 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,35 @@
1212
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
1313
"lint:fix": "yarn run lint --fix",
1414
"pretty": "prettier -w '{**/*,*}.{js,ts,jsx,tsx,json,yml}'",
15+
"pretty:check": "prettier -c '{**/*,*}.{js,ts,jsx,tsx,json,yml}'",
1516
"server": "docker-compose up --build",
1617
"start": "npm run watch",
1718
"sign": "npx --yes @grafana/sign-plugin@latest",
1819
"e2e": "playwright test",
1920
"e2e:ci": "playwright test",
20-
"e2e:debug": "playwright test --debug"
21+
"e2e:debug": "playwright test --debug",
22+
"e2e:ui": "playwright test --ui"
2123
},
2224
"author": "Checkmk",
2325
"license": "Apache-2.0",
2426
"devDependencies": {
2527
"@babel/core": "^7.25.2",
2628
"@grafana/eslint-config": "^7.0.0",
27-
"@grafana/plugin-e2e": "^1.7.1",
29+
"@grafana/plugin-e2e": "^1.7.2",
2830
"@grafana/tsconfig": "^2.0.0",
29-
"@playwright/test": "^1.46.1",
31+
"@playwright/test": "^1.47.0",
3032
"@swc/core": "^1.7.23",
3133
"@swc/helpers": "^0.5.13",
3234
"@swc/jest": "^0.2.36",
3335
"@testing-library/jest-dom": "6.5.0",
3436
"@testing-library/react": "16.0.1",
3537
"@types/jest": "^29.5.12",
3638
"@types/lodash": "^4.17.7",
37-
"@types/node": "^22.5.3",
39+
"@types/node": "^22.5.4",
3840
"@types/react-router-dom": "^5.3.3",
3941
"copy-webpack-plugin": "^12.0.2",
4042
"css-loader": "^7.1.2",
43+
"dotenv": "^16.4.5",
4144
"eslint-plugin-deprecation": "^3.0.0",
4245
"eslint-webpack-plugin": "^4.2.0",
4346
"fork-ts-checker-webpack-plugin": "^9.0.2",

playwright.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ export default defineConfig<PluginOptions>({
2020
name: 'e2e tests',
2121
testDir: './tests/e2e/tests',
2222
testMatch: ['**/*.test.ts'],
23+
dependencies: ['setup'],
24+
},
25+
{
26+
name: 'setup',
27+
testDir: './tests/e2e/tests',
28+
testMatch: 'global.setup.ts',
29+
teardown: 'tearDown',
30+
},
31+
{
32+
name: 'tearDown',
33+
testDir: './tests/e2e/tests',
34+
testMatch: 'global.teardown.ts',
2335
},
2436
],
2537
});

src/plugin.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"name": "Checkmk GmbH",
1111
"url": "https://github.com/Checkmk/"
1212
},
13-
"keywords": [
14-
"checkmk"
15-
],
13+
"keywords": ["checkmk"],
1614
"logos": {
1715
"small": "img/checkmk_logo.svg",
1816
"large": "img/checkmk_logo.svg"

tests/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ FROM mcr.microsoft.com/playwright:v1.46.1-jammy
22

33
WORKDIR /app
44

5-
COPY . ./
5+
COPY ./package*.json ./
66

77
RUN apt-get update && \
88
apt-get install -y jq && \
9-
npm install && \
9+
npm ci && \
1010
npx playwright install --with-deps
1111

12+
COPY . ./
13+
1214
ENTRYPOINT [ "npm", "run", "e2e:ci" ]

tests/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ services:
1919
GF_SECURITY_ADMIN_USER: admin
2020
GF_SECURITY_ADMIN_PASSWORD: password
2121
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: tribe-29-checkmk-datasource
22+
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
23+
GF_AUTH_ANONYMOUS_ENABLED: 'true'
2224
extra_hosts:
2325
- checkmk.local:host-gateway
2426
ports:

0 commit comments

Comments
 (0)