Skip to content

Commit

Permalink
do not depend on code climate for coverage report (#3431)
Browse files Browse the repository at this point in the history
  • Loading branch information
kedashoe committed Dec 4, 2023
1 parent 246fbac commit 74cfca7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 22 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,6 @@ name: Build
on: [push, pull_request]

jobs:
coverage:
runs-on: ubuntu-latest
name: Code Climate Coverage
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Installing Dependencies
run: npm ci

- name: Collecting Coverage
uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_TOKEN }}
with:
coverageCommand: npm run coverage
coverageLocations: |
${{github.workspace}}/coverage/lcov.info:lcov
build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -30,9 +11,9 @@ jobs:
name: Node ${{ matrix.node }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Installing Dependencies
- name: Clean Install
run: npm ci

- name: Linting Codebase
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Coverage

on:
pull_request_target:
types: [edited, opened, synchronize, ready_for_review, review_requested, reopened]

jobs:
coverage:
if: github.repository == 'ramda/ramda'
runs-on: ubuntu-latest
name: Coverage

permissions:
issues: write
contents: read
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Clean Install
run: npm ci

- name: Run Coverage
id: run-coverage
run: |
{
echo 'COVERAGE_OUTPUT<<EOF'
npm run coverage
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Log Coverage
env:
COVERAGE_OUTPUT: ${{ steps.run-coverage.outputs.COVERAGE_OUTPUT }}
run: echo "$COVERAGE_OUTPUT"

- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
continue-on-error: true
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Coverage Results

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<details>
<summary>Coverage Results</summary>
```bash
${{ steps.run-coverage.outputs.COVERAGE_OUTPUT }}
```
</details>
edit-mode: replace

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"partial-build": "node ./scripts/partialBuild",
"clean": "rimraf es/* src/* dist/* coverage/*",
"prepare": "npm run clean && npm run build",
"coverage": "BABEL_ENV=cjs nyc --reporter=lcov mocha -- --require @babel/register",
"coverage": "BABEL_ENV=cjs nyc --reporter=text-summary --reporter=text mocha -- --reporter=min --require @babel/register",
"lint": "eslint scripts/bookmarklet scripts/*.js source/*.js source/internal/*.js test/*.js test/**/*.js lib/sauce/*.js lib/bench/*.js",
"browser_test": "testem ci",
"spec": "cross-env BABEL_ENV=cjs mocha --require @babel/register --reporter spec",
Expand Down

0 comments on commit 74cfca7

Please sign in to comment.