Git Product home page Git Product logo

tsc-diagnostics-diff-action's Introduction

TypeScript Performance Diagnostics Diff Action

This GitHub action allows you to measure and track TypeScript performance regressions in your projects by comparing tsc --diagnostics (or --extendedDiagnostics based on your configuration) outputs between the base branch and the current branch.

Inputs

  • base-branch: The branch that the actions should use to compare TSC performance (default: 'main').
  • custom-command: Allows to override the default type check command. Your custom command should print either --diagnostics or --extendedDiagnostics output. (default: yarn tsc --noEmit --incremental false --diagnostics/--extendedDiagnostics).
  • leave-comment: Indicates whether the action should leave a comment on a PR. Enabling this requires providing the github-token input (default: false).
  • github-token: GitHub API token. Necessary to leave comments on your PRs.
  • extended: Indicates whether the actions should use --extendedDiagnostics over --diagnostics (default: false).

Usage

You can add this action to your workflow file like this:

name: Check TypeScript Performance

on:
  pull_request:

jobs:
  check-performance:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Use Node.js 16.x
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
      - name: Install dependencies
        run: npm ci
      - name: TSC Diagnostics Diff
        uses: beerose/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          leave-comment: true

This example uses GITHUB_TOKEN to leave a comment on PRs with the diagnostics comparison.

Example output

CleanShot 2023-05-18 at 14 17 53@2x

Development

Install the dependencies

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

Run the tests ✔️

$ npm test

 PASS  ./index.test.js
  ✓ throws invalid number (3ms)
  ✓ wait 500 ms (504ms)
  ✓ test runs (95ms)

...

Publish to a distribution branch

Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run ncc and push the results:

$ npm run package
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1

Validate

You can now validate the action by referencing ./ in a workflow in your repo (see test.yml)

uses: ./
with: ...

See the actions tab for runs of this action! 🚀

tsc-diagnostics-diff-action's People

Contributors

beerose avatar danielroe avatar kocal avatar

Stargazers

Andreas Storesund Madsen avatar Jonathan MASSUCHETTI avatar Martino Pizzol avatar Olle Mineur avatar Andreas Lindberg avatar Connor Walsh avatar Mehmet avatar Maciej Gąsiorowski avatar Federico Erostarbe avatar  avatar Alexandre Theodoro da Silva avatar Kevon Eaglin avatar Vincent avatar Djobbo-Victor avatar Sachit avatar  avatar Yassine El Bouziady avatar Jan T. Sott avatar Hsin-lin Cheng avatar Jean-Sébastien Herbaux avatar DW avatar JC avatar 余腾靖 avatar Huy Giang avatar Aleksandar Toplek avatar Toni Villena avatar Mikey Stengel avatar Alessandro Gambin da Silva avatar Alexandre Stahmer avatar Mariusz Szubryt avatar Naser Aleisa avatar Radu-Cristian Popa avatar Michael J. Roberts avatar Marius Pocevičius avatar Jonathan Silva avatar awkweb avatar Richard Willis avatar Matt Pocock avatar Sándor Levcsák avatar Nikita avatar Johnson Chu avatar Zhazha_JiaYiZhen avatar  avatar TK avatar  avatar @Eusoukaio avatar Nima Karimi avatar Saurabh Suthar avatar Anurag Hazra avatar  avatar Vlad Sazonau avatar Oliver Joseph Ash avatar Julien Mastromonaco avatar David Abram avatar  avatar Andris Sīlis avatar ntnyq avatar Florian Wendelborn avatar Lukáš avatar Andrejs Agejevs avatar Tomáš Horáček avatar Laurin Quast avatar Nicolas Charpentier avatar maksim hodasevich avatar Piotr Monwid-Olechnowicz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.