Code Metrics Report #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code Report Workflow | |
name: Code Metrics Report | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * WED' | |
jobs: | |
code-report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Codebase | |
uses: actions/checkout@v2 | |
- name: Configure Node version and registry | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- name: Install Dependencies | |
run: npm ci | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Get Lines Count - Codebase | |
run: npx cloc ./lib --json --report-file=./code-report/codebase.json | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Running Tests - API | |
run: npm run test:cov 2>&1 | tee ./code-report/coverage.txt | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Compile Code Report | |
run: | | |
echo "Code Report:" | |
echo "Code Lines: $(cat ./code-report/codebase.json | jq '.SUM.code')" | |
echo "$(cat ./code-report/coverage.txt | tail -12)" | |