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

Code climate tests #175

Merged
merged 4 commits into from
Oct 4, 2023
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
20 changes: 0 additions & 20 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/code-climate-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Climate Test Reporter

on:
push:
branches: [main]

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
code-climate:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
- run: npm ci
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: ./cc-test-reporter before-build
- run: npm run coverage
- run: ./cc-test-reporter format-coverage -t lcov coverage/lcov.info
- run: ./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ yarn-error.log*
license-report.md

.idea
.eslintcache
.eslintcache

# tests coverage
coverage
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
"build": "rollup -c",
"prepare": "run-s build && husky install",
"test": "npx @guidesmiths/license-checker --failOn AGPL --outputFileName License-report --errorReportFileName License-error | run-s test:unit test:lint test:build",
"coverage": "npm run test:unit -- --coverage",
"test:build": "run-s build",
"test:lint": "eslint src --ext .js,.jsx --config .eslintrc --ignore-path .eslintignore --cache",
"eslint:fix": "eslint . --ext .js,.jsx --fix",
"lint": "npm run test:lint",
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom --passWithNoTests",
"test:watch": "react-scripts test --env=jsdom",
"eslint:fix": "eslint . --ext .js,.jsx --fix",
"lint": "npm run test:lint",
"predeploy": "cd example && npm install && npm run build",
"deploy": "gh-pages -d example/build",
"release:patch": "git tag -l | xargs git tag -d && changelog -p && git add CHANGELOG.md && git commit -m 'chore: updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags",
Expand Down