fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
10.04k stars 1.13k forks source link

Action to build js files automatically #844

Closed da-h closed 2 years ago

da-h commented 2 years ago

Description

This PR moves the requirement to commit build files from the contributor to a dedicated github action.

Motivation and Context

The goal of this PR is to ensure consistency across builds on the one hand, and to increase security of the deployment on the other hand.

How Has This Been Tested?

See the action result in my own test branch

Notes

The new action triggers on any pushes of the js/** files. Alternatively, it would be reasonable to either

Types of changes

Checklist:

da-h commented 2 years ago

Quick question on the suggestion for improvement: what do you mean exactly? Only resource I can find is the use of ${{ failure() }} in an action to save build failure logs. I am somewhat at a loss here. :sweat_smile:

JackUrb commented 2 years ago

To some degree I'm not sure if it would already happen (that the action would display a failure) if you were to make a mistake. Can be tested by putting a package that doesn't exist into the package.json (to test npm install) and then making an unparsable syntax error in the js code (to test npm run build).

da-h commented 2 years ago

Indeed, this is the case. I just double checked this for both mentioned scenarios:

image