Skip to content

Commit

Permalink
PMM-7 Refactor code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkubinec committed Sep 24, 2024
1 parent d84e854 commit 543e839
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
55 changes: 30 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,37 @@ jobs:
- name: Run unit tests
run: cd pmm-app && yarn test:ci

code_coverage:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
cache-dependency-path: pmm-app/yarn.lock
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_GRAFANA_DASHBOARDS_TOKEN }}

- name: Download built packages
uses: actions/download-artifact@v3
- uses: codecov/codecov-action@v4
with:
name: build-dist
path: pmm-app/dist/

- name: Install deps
run: make prepare_release

- name: Generate Coverage
run: make generate_coverage
token: ${{ secrets.CODECOV_GRAFANA_DASHBOARDS_TOKEN }}
verbose: true

# code_coverage:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - name: Setup NodeJS
# uses: actions/setup-node@v4
# with:
# node-version: "18"
# cache: "yarn"
# cache-dependency-path: pmm-app/yarn.lock
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_GRAFANA_DASHBOARDS_TOKEN }}

# - name: Download built packages
# uses: actions/download-artifact@v3
# with:
# name: build-dist
# path: pmm-app/dist/

# - name: Install deps
# run: make prepare_release

# - name: Generate Coverage
# run: make generate_coverage

workflow_success:
needs: [unit_tests, code_coverage, build]
Expand Down
4 changes: 2 additions & 2 deletions pmm-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"server": "docker-compose up --build",
"sign": "npx --yes @grafana/sign-plugin@latest",
"test": "jest --watch --onlyChanged",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"test:ci": "jest --passWithNoTests --maxWorkers 4 --collectCoverage",
"typecheck": "tsc --noEmit"
},
"bin": {
Expand Down Expand Up @@ -100,7 +100,7 @@
"@types/react-scrollbar": "^0.5.1",
"@types/testing-library__jest-dom": "5.14.8",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"codecov": "^3.6.5",
"codecov": "^3.8.3",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"enzyme": "^3.11.0",
Expand Down
2 changes: 1 addition & 1 deletion pmm-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4319,7 +4319,7 @@ co@^4.6.0:
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==

codecov@^3.6.5:
codecov@^3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.8.3.tgz#9c3e364b8a700c597346ae98418d09880a3fdbe7"
integrity sha512-Y8Hw+V3HgR7V71xWH2vQ9lyS358CbGCldWlJFR0JirqoGtOoas3R3/OclRTvgUYFK29mmJICDPauVKmpqbwhOA==
Expand Down

0 comments on commit 543e839

Please sign in to comment.