Skip to content

Commit 99b2267

Browse files
authored
docs: prepare documentation for v1.0.0 release 🎉 (#8)
1 parent 49e2096 commit 99b2267

File tree

4 files changed

+34
-108
lines changed

4 files changed

+34
-108
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 1.0.0
2+
3+
- initial release 🎉
4+
- includes coverage comparison
5+
- `path` input override
6+
- `min_coverage` threshold override

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 GitHub Actions
3+
Copyright (c) 2020 Very Good Ventures
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 17 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,33 @@
1-
# Create a JavaScript Action
1+
# Very Good Coverage
22

3-
<p align="center">
4-
<a href="https://github.com/actions/javascript-action/actions"><img alt="javscript-action status" src="https://github.com/actions/javascript-action/workflows/units-test/badge.svg"></a>
5-
</p>
3+
[![Very Good Ventures](https://raw.githubusercontent.com/VGVentures/very_good_analysis/main/assets/vgv_logo.png)](https://verygood.ventures)
64

7-
Use this template to bootstrap the creation of a JavaScript action.:rocket:
5+
Developed with 💙 by [Very Good Ventures](https://verygood.ventures) 🦄
86

9-
This template includes tests, linting, a validation workflow, publishing, and versioning guidance.
7+
[![units-test](https://github.com/VGVentures/very-good-coverage/workflows/units-test/badge.svg)](https://github.com/VGVentures/very_good_analysis/actions)
8+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
109

11-
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
10+
A Github Action which helps enforce a minimum code coverage threshold.
1211

13-
## Create an action from this template
12+
## Inputs
1413

15-
Click the `Use this Template` and provide the new repo details for your action
14+
### `path`
1615

17-
## Code in Main
16+
**Optional** The path to the `lcov.info` file.
1817

19-
Install the dependencies
18+
**Default** `./coverage/lcov.info`
2019

21-
```bash
22-
npm install
23-
```
24-
25-
Run the tests :heavy_check_mark:
26-
27-
```bash
28-
$ npm test
29-
30-
PASS ./index.test.js
31-
✓ throws invalid number (3ms)
32-
wait 500 ms (504ms)
33-
test runs (95ms)
34-
...
35-
```
36-
37-
## Change action.yml
38-
39-
The action.yml contains defines the inputs and output for your action.
40-
41-
Update the action.yml with your name, description, inputs and outputs for your action.
42-
43-
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
20+
### `min_coverage`
4421

45-
## Change the Code
22+
**Optional** The minimum coverage percentage allowed.
4623

47-
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
24+
**Default** 100
4825

49-
```javascript
50-
const core = require('@actions/core');
51-
...
52-
53-
async function run() {
54-
try {
55-
...
56-
}
57-
catch (error) {
58-
core.setFailed(error.message);
59-
}
60-
}
61-
62-
run()
63-
```
64-
65-
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
66-
67-
## Package for distribution
68-
69-
GitHub Actions will run the entry point from the action.yml. Packaging assembles the code into one file that can be checked in to Git, enabling fast and reliable execution and preventing the need to check in node_modules.
70-
71-
Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.
72-
73-
Run prepare
74-
75-
```bash
76-
npm run prepare
77-
```
78-
79-
Since the packaged index.js is run from the dist folder.
80-
81-
```bash
82-
git add dist
83-
```
84-
85-
## Create a release branch
86-
87-
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
88-
89-
Checkin to the v1 release branch
90-
91-
```bash
92-
git checkout -b v1
93-
git commit -a -m "v1 release"
94-
```
95-
96-
```bash
97-
git push origin v1
98-
```
99-
100-
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
101-
102-
Your action is now published! :rocket:
103-
104-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
105-
106-
## Usage
107-
108-
You can now consume the action by referencing the v1 branch
26+
## Example usage
10927

11028
```yaml
111-
uses: actions/javascript-action@v1
29+
uses: VGVentures/very-good-coverage@v1.0.0
11230
with:
113-
milliseconds: 1000
31+
path: "./coverage/lcov.info"
32+
min_coverage: 95
11433
```
115-
116-
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "javascript-action",
2+
"name": "very-good-coverage",
33
"version": "1.0.0",
4-
"description": "JavaScript Action Template",
4+
"description": "A Github Action which helps enforce code coverage threshold using lcov",
55
"main": "index.js",
66
"scripts": {
77
"lint": "eslint .",
@@ -11,19 +11,22 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/actions/javascript-action.git"
14+
"url": "git+https://github.com/VGVentures/very-good-coverage.git"
1515
},
1616
"keywords": [
1717
"GitHub",
1818
"Actions",
19-
"JavaScript"
19+
"Coverage",
20+
"JavaScript",
21+
"lcov",
22+
"testing"
2023
],
21-
"author": "",
24+
"author": "[email protected]",
2225
"license": "MIT",
2326
"bugs": {
24-
"url": "https://github.com/actions/javascript-action/issues"
27+
"url": "https://github.com/VGVentures/very-good-coverage/issues"
2528
},
26-
"homepage": "https://github.com/actions/javascript-action#readme",
29+
"homepage": "https://github.com/VGVentures/very-good-coverage",
2730
"dependencies": {
2831
"@actions/core": "^1.2.5",
2932
"lcov-parse": "^1.0.0"

0 commit comments

Comments
 (0)