Skip to content

Commit c6cb0db

Browse files
committed
setup github workflow
1 parent 24fecff commit c6cb0db

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build_test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
node-version: [14, 12, 10]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Get yarn cache directory
26+
id: yarn-cache
27+
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
29+
- name: Set dependencies cache
30+
uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.yarn-cache.outputs.dir }}
33+
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
36+
${{ runner.os }}-${{ matrix.node_version }}-
37+
- name: Versions
38+
run: yarn versions
39+
40+
- name: Install dependencies
41+
run: yarn install --frozen-lockfile
42+
43+
- name: Build
44+
run: yarn build
45+
46+
- name: Test
47+
run: yarn test
48+
49+
lint:
50+
runs-on: ubuntu-latest
51+
name: 'Lint: node@14, ubuntu-latest'
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Set node version to 14
58+
uses: actions/setup-node@v2
59+
with:
60+
node-version: 14
61+
62+
- name: Set dependencies cache
63+
uses: actions/cache@v2
64+
with:
65+
path: ~/.cache/yarn
66+
key: lint-dependencies-${{ hashFiles('yarn.lock') }}
67+
restore-keys: |
68+
lint-dependencies-${{ hashFiles('yarn.lock') }}
69+
lint-dependencies-
70+
- name: Prepare
71+
run: |
72+
yarn install --frozen-lockfile
73+
yarn build
74+
- name: Lint
75+
run: yarn lint

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# jsonFromTable
22

3-
Converts html tables to JSON and JS objects
3+
Convert html tables to javascript objects, array or json.
4+
5+
<a href="https://www.npmjs.com/package/sjsonfromtable"><img alt="NPM" src="https://img.shields.io/npm/v/jsonfromtable" /></a>
6+
<a href="https://github.com/coderosh/jsonfromtable"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
7+
<a href="#"><img alt="CI" src="https://img.shields.io/github/workflow/status/coderosh/jsonfromtable/CI"></a>
8+
<a href="https://github.com/coderosh/jsonfromtalbe"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" /></a>
9+
<a href="https://github.com/coderosh/jsonfromtalbe"><img src="https://img.shields.io/badge/types-typescript-blue.svg" alt="Typescript" /></a>
410

511
## Installation
612

@@ -10,10 +16,17 @@ Install via npm
1016
npm install jsonfromtable
1117
```
1218

19+
Or yarn
20+
21+
```sh
22+
yarn add jsonfromtable
23+
```
24+
1325
## Usage
1426

1527
```js
1628
const { jsonFromtable } = require('jsonfromtable')
29+
// OR import { jsonFromTable } from "jsonfromtable"
1730

1831
const obj = jsonFromTable({
1932
html: `<table>...</table>`,

0 commit comments

Comments
 (0)