1
0
Fork 0

update readme

pull/183/head
Bryan MacFarlane 2019-10-03 12:45:11 -04:00
parent a1c30dfc53
commit 1643ea2734
2 changed files with 43 additions and 18 deletions

View File

@ -1,5 +1,9 @@
name: toolkit-unit-tests
on: [push]
on:
push:
paths:
- 'packages/**'
- '*.json'
jobs:
Ubuntu:
name: Run Ubuntu

View File

@ -7,10 +7,15 @@
<a href="https://github.com/actions/toolkit"><img alt="GitHub Actions status" src="https://github.com/actions/toolkit/workflows/toolkit-unit-tests/badge.svg"></a>
</p>
## GitHub Actions Toolkit
The GitHub Actions ToolKit provides a set of packages to make creating actions easier.
<br/>
<h3 align="center">Get started with the <a href="https://github.com/actions/javascript-action">javascript-action template</a>!</h3>
<br/>
## Packages
:heavy_check_mark: [@actions/core](packages/core)
@ -66,6 +71,12 @@ Outlines the differences and why you would want to create a JavaScript or a cont
<br/>
<br/>
:curly_loop: [Versioning](docs/action-versioning.md)
Actions are downloaded and run from the GitHub graph of repos. This contains guidance for versioning actions and safe releases.
<br/>
<br/>
[Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
Illustrates how to create a simple hello world javascript action.
@ -83,6 +94,13 @@ Illustrates how to create a simple hello world javascript action.
Walkthrough and template for creating a JavaScript Action with tests, linting, workflow, publishing, and versioning.
```javascript
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
...
```
```javascript
PASS ./index.test.js
✓ throws invalid number
@ -107,13 +125,15 @@ async function run() {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
...
```
```javascript
PASS ./index.test.js
✓ throws invalid number
✓ wait 500 ms
✓ test runs
} catch (error) {
core.setFailed(error.message);
}
}
run();
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
```
<br/>
<br/>
@ -124,11 +144,8 @@ Create an action that is delivered as a container and run with docker.
```docker
FROM alpine:3.10
COPY LICENSE README.md /
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
```
<br/>
@ -138,6 +155,12 @@ ENTRYPOINT ["/entrypoint.sh"]
Create an action that is delivered as a container which uses the toolkit. This example uses the GitHub context to construct an Octokit client.
```docker
FROM node:slim
COPY . .
RUN npm install --production
ENTRYPOINT ["node", "/lib/main.js"]
```
```javascript
const myInput = core.getInput('myInput');
core.debug(`Hello ${myInput} from inside a container`);
@ -148,8 +171,6 @@ Create an action that is delivered as a container which uses the toolkit. This
<br/>
<br/>
:curly_loop: [Versioning](docs/action-versioning.md)
Recommendations on versioning, releases and tagging your action.
<br/>
<br/>