Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-7 Run unit tests for QAN & add CI for setup page #1593

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test pipeline

on: pull_request
on:
pull_request:
paths:
- pmm-app/**

jobs:
build:
Expand Down Expand Up @@ -29,6 +32,28 @@ jobs:
path: pmm-app/dist/
if-no-files-found: error

unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run with Node 16
uses: actions/setup-node@v4
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: pmm-app/yarn.lock

- name: Install deps
run: make prepare_release

- name: Run lint
run: cd pmm-app && yarn lint:check

- name: Run unit tests
run: cd pmm-app && yarn test

code_coverage:
needs: build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -57,7 +82,7 @@ jobs:
run: make generate_coverage

workflow_success:
needs: [code_coverage, build]
needs: [unit_tests, code_coverage, build]
name: Slack Notification success
runs-on: ubuntu-latest
env:
Expand All @@ -77,7 +102,7 @@ jobs:

workflow_failure:
if: ${{ failure() }}
needs: [code_coverage, build]
needs: [unit_tests, code_coverage, build]
name: Slack Notification failure
runs-on: ubuntu-latest
env:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/setup-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup Page pipeline

on:
pull_request:
paths:
- setup-page/**

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run with Node 18
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: setup-page/package-lock.json

- name: Install deps
run: cd setup-page && npm ci

- name: Run lint
run: cd setup-page && npm run lint

- name: Run build
run: cd setup-page && npm run build
1 change: 1 addition & 0 deletions pmm-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dev": "npm run monkey-patch && grafana-toolkit plugin:dev",
"watch": "npm run monkey-patch && grafana-toolkit plugin:dev --watch",
"lint": "npm run lint:dev",
"lint:check": "eslint --ext .tsx,.ts src/",
"lint:dev": "eslint --ext .tsx,.ts --fix src/",
"jest": "jest",
"codecov": "codecov"
Expand Down
1 change: 1 addition & 0 deletions setup-page/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ yarn-error.log*
yarn.lock
.parcel-cache
dist
build
Loading