Skip to content

πŸ“Š Generates Solidity Code Metrics Reports for Solidity Source Units in your Repository.

Notifications You must be signed in to change notification settings

tintinweb/solidity-metrics-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

get in touch with Consensys Diligence
[ 🌐 πŸ“© πŸ”₯ ]

Solidity Metrics GitHub Action

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

Powered by solidity-code-metrics.

image

Sample Report (html)

Usage

Include it in your GitHub Actions file after a checkout.

- 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: <metrics> allows us to access the generated report with ${{ steps.<metrics>.outputs.report }}).
  3. Upload ${{ steps.<metrics>.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).

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