Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tintinweb/solidity-metrics-action

📊 Generates Solidity Code Metrics Reports for Solidity Source Units in your Repository.
https://github.com/tintinweb/solidity-metrics-action

github-action solidity

Last synced: 3 months ago
JSON representation

📊 Generates Solidity Code Metrics Reports for Solidity Source Units in your Repository.

Awesome Lists containing this project

README

        

[get in touch with Consensys Diligence](https://diligence.consensys.net)


[[ 🌐 ](https://diligence.consensys.net) [ 📩 ](https://github.com/ConsenSys/vscode-solidity-metrics/blob/master/mailto:[email protected]) [ 🔥 ](https://consensys.github.io/diligence/)]


# Solidity Metrics GitHub Action

Generate a Solidity Code Metrics HTML-Report for your Project.


Powered by solidity-code-metrics.

image

[Sample Report (html)](./sample/__metrics.html)

## Usage

Include it in your GitHub Actions file after a checkout.

```yaml
- name: 📊 Crunch Numbers
uses: tintinweb/solidity-metrics-action@v1
id: metrics
with:
target: '{,**/}*.sol'
```

Generates a HTML metrics report in the workspace root. The path can be accessed via `${{ steps.metrics.outputs.report }}` (by default: `__metrics.html`).

## Example Job

1. Checkout the codebase
2. Generate the Metrics report (Note: `id: ` allows us to access the generated report with `${{ steps..outputs.report }}`).
3. Upload `${{ steps..outputs.report }}` as an artifact to the job

The `target` argument takes a single glob to select input files. By default it will try to load any `*.sol` file in the root or sub-paths (i.e. `{,**/}*.sol`).

```yaml
name: Metrics

on:
pull_request:
branches: [ master ]

jobs:
metrics:
name: 📊 Code Metrics
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/checkout@v3
- name: 📊 Crunch Numbers
uses: tintinweb/solidity-metrics-action@v1
id: metrics
with:
target: '{,**/}*.sol'
- uses: actions/upload-artifact@v3
with:
name: metrics.html
path: ${{ steps.metrics.outputs.report }}
```

image