From 0153ce96d8b9ddaa3e54557f15ef79d51a645c25 Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 27 Jan 2024 17:08:20 +0900 Subject: [PATCH 1/2] Enable collecting coverage on the frontend --- .github/workflows/build-frontend.yml | 6 ++++++ .gitignore | 3 ++- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index 2e552da38..cd8c1cf58 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -70,3 +70,9 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: test run: npm run test + - name: codecov + uses: codecov/codecov-action@v3 + with: + token: ${{secrets.CODECOV_TOKEN}} + flags: ui + continue-on-error: true diff --git a/.gitignore b/.gitignore index 9280bf01a..634f90487 100644 --- a/.gitignore +++ b/.gitignore @@ -169,9 +169,10 @@ docs/public # https://qiita.com/knakajima3027/items/f8d10e3066fbcde117d3 static_root -# React +# JavaScript, TypeScript, React node_modules static/js/ui.js* +coverage # local django configuration airone/settings.py diff --git a/package.json b/package.json index 53a6737d5..60212eca4 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "watch:custom": "webpack build --watch --entry ./frontend/src/customview/CustomApp.tsx --mode development", "lint": "npx eslint frontend && npx prettier --check frontend", "fix": "npx eslint --fix frontend ; npx prettier --write frontend", - "test": "TZ=UTC npx jest frontend", + "test": "TZ=UTC npx jest --coverage frontend", "test:update": "TZ=UTC npx jest -u frontend" }, "repository": { From 530d77e5abca5cb1feb3a809aaf0b592040a2c3b Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 27 Jan 2024 17:15:39 +0900 Subject: [PATCH 2/2] Simplify codecov step with existing action --- .github/workflows/build-core.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 7aea9b966..f309a684d 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -91,9 +91,9 @@ jobs: poetry run tox env: TOXENV: "py311" - - name: Coverage - run: | - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} + - name: coverage + uses: codecov/codecov-action@v3 + with: + token: ${{secrets.CODECOV_TOKEN}} + flags: core continue-on-error: true