All Projects → coverallsapp → Github Action

coverallsapp / Github Action

Licence: mit
Coveralls Github Action

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Github Action

Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (+222.43%)
Mutual labels:  ci, code-coverage
Flakehell
Flake8 wrapper to make it nice, legacy-friendly, configurable.
Stars: ✭ 217 (+1.4%)
Mutual labels:  ci, code-quality
Skunk
A SkunkScore Calculator for Ruby Code -- Find the most complicated code without test coverage!
Stars: ✭ 228 (+6.54%)
Mutual labels:  code-quality, code-coverage
jacoco-report
Github action that publishes the JaCoCo report as a comment in the Pull Request
Stars: ✭ 31 (-85.51%)
Mutual labels:  code-quality, code-coverage
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (-47.66%)
Mutual labels:  ci, code-quality
megalinter
🦙 Mega-Linter analyzes 48 languages, 22 formats, 19 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
Stars: ✭ 534 (+149.53%)
Mutual labels:  ci, code-quality
python-test-reporter
DEPRECATED Uploads Python test coverage data to Code Climate
Stars: ✭ 18 (-91.59%)
Mutual labels:  ci, code-quality
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+2021.96%)
Mutual labels:  ci, code-quality
Single cov
Actionable code coverage.
Stars: ✭ 154 (-28.04%)
Mutual labels:  code-quality, code-coverage
Poetry Calendar
✨🗓✨一个美炸天的诗词周历 , 52个周给你新的体验。
Stars: ✭ 192 (-10.28%)
Mutual labels:  ci
Dont Break
Checks if the current version of your package would break dependent projects
Stars: ✭ 200 (-6.54%)
Mutual labels:  ci
Gradle Baseline
A set of Gradle plugins that configure default code quality tools for developers.
Stars: ✭ 191 (-10.75%)
Mutual labels:  code-quality
Code Coverage
Saves the code coverage collected during Cypress tests
Stars: ✭ 192 (-10.28%)
Mutual labels:  code-coverage
Cml
♾️ CML - Continuous Machine Learning | CI/CD for ML
Stars: ✭ 2,843 (+1228.5%)
Mutual labels:  ci
Woke
✊ Detect non-inclusive language in your source code.
Stars: ✭ 190 (-11.21%)
Mutual labels:  ci
Dotenv Linter
☺️ Linting dotenv files like a charm!
Stars: ✭ 207 (-3.27%)
Mutual labels:  code-quality
Jest Canvas Mock
🌗 A module used to mock canvas in Jest.
Stars: ✭ 189 (-11.68%)
Mutual labels:  ci
Codeclimate
Code Climate CLI
Stars: ✭ 2,273 (+962.15%)
Mutual labels:  code-quality
Scripts
Scripts for use on Codeship Basic
Stars: ✭ 211 (-1.4%)
Mutual labels:  ci
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (-5.61%)
Mutual labels:  code-coverage

logo

Coveralls GitHub Action

This GitHub Action posts your test suite's LCOV coverage data to coveralls.io for analysis, change tracking, and notifications. You don't need to add the repo to Coveralls first, it will be created when receiving the post.

When running on pull_request events, a comment will be added to the PR with details about how coverage will be affected if merged.

Usage

The action's step needs to run after your test suite has outputted an LCOV file. Most major test runners can be configured to do so; if you're using Node, see more info here.

Inputs:

Name Requirement Description
github-token required Must be in form github-token: ${{ secrets.GITHUB_TOKEN }}; Coveralls uses this token to verify the posted coverage data on the repo and create a new check based on the results. It is built into Github Actions and does not need to be manually specified in your secrets store. More Info
path-to-lcov optional Default: "./coverage/lcov.info". Local path to the lcov output file produced by your test suite. An error will be thrown if the file can't be found. This is the file that will be sent to the Coveralls API.
flag-name optional (unique required if parallel) Job flag name, e.g. "Unit", "Functional", or "Integration". Will be shown in the Coveralls UI.
parallel optional Set to true for parallel (or matrix) based steps, where multiple posts to Coveralls will be performed in the check. flag-name needs to be set and unique, e.g. flag-name: run-${{ matrix.test_number }}
parallel-finished optional Set to true in the last job, after the other parallel jobs steps have completed, this will send a webhook to Coveralls to set the build complete.
coveralls-endpoint optional Hostname and protocol: https://<host>; Specifies a Coveralls Enterprise hostname.
base-path optional Path to the root folder of the project the coverage was collected in. Should be used in monorepos so that coveralls can process the LCOV correctly (e.g. packages/my-project)

Outputs:

  • coveralls-api-result: JSON response from the Coveralls API with a status code and url for the Job on Coveralls.

Standard Example:

  • This example assumes you're building a Node project using the command make test-coverage, demo here: nickmerwin/node-coveralls
on: ["push", "pull_request"]

name: Test Coveralls

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - uses: actions/[email protected]

    - name: Use Node.js 10.x
      uses: actions/[email protected]
      with:
        node-version: 10.x

    - name: npm install, make test-coverage
      run: |
        npm install
        make test-coverage

    - name: Coveralls
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

Complete Parallel Job Example:

on: ["push", "pull_request"]

name: Test Coveralls Parallel

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        test_number:
          - 1
          - 2
    steps:
    - uses: actions/[email protected]
    - name: Use Node.js 10.x
      uses: actions/[email protected]
      with:
        version: 10.x

    - name: npm install
      run: npm install

    - name: Test ${{ matrix.test_number }}
      run: make test-coverage-${{ matrix.test_number }}
    - name: Coveralls Parallel
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.github_token }}
        flag-name: run-${{ matrix.test_number }}
        parallel: true

  finish:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - name: Coveralls Finished
      uses: coverallsapp/[email protected]
      with:
        github-token: ${{ secrets.github_token }}
        parallel-finished: true

The "Coveralls Finished" step needs to run after all other steps have completed; it will let Coveralls know that all jobs in the build are done and aggregate coverage calculation can be calculated and notifications sent.

Demo

demo

Steps shown:

  1. A new function f without test coverage is added.
  2. The changes are committed and pushed to a new branch "function/f"
  3. The Action runs on GitHub CI.
  4. The commit on GitHub shows a new check for Coveralls with details "First build on function-f at 92.0%", and links to the Job on Coveralls.
  5. Line-by-line results indicate the new function is missing coverage.
  6. Create a pull request with the new branch.
  7. The pull_request check runs and the resulting coverage data triggers a fail status.
  8. A detailed comment is posted.

Troubleshooting:

Coveralls comments aren't added to my pull request

Ensure your workflow that invokes the Coveralls action runs on pull requests, e.g.:

on: ["push", "pull_request"]

Coveralls responds with "cannot find matching repository"

Ensure your workflow yaml line for the GitHub token matches exactly:

github-token: ${{ secrets.GITHUB_TOKEN }}

MIT License

Contributing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].