Skip to content

Commit 282fcab

Browse files
authored
Merge pull request #1694 from hackmdio/chore/github-actions
Run CI with GitHub Actions
2 parents 8c20d9f + dcfdb01 commit 282fcab

File tree

2 files changed

+51
-32
lines changed

2 files changed

+51
-32
lines changed

.github/workflows/build.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Test and Build'
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
test-and-build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [10.x, 12.x]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- uses: actions/cache@v2
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-
24+
25+
- uses: actions/setup-node@v2
26+
name: Use Node.js ${{ matrix.node-version }}
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
check-latest: true
30+
31+
- run: npm ci
32+
- run: npm run test:ci
33+
- run: npm run build
34+
35+
doctoc:
36+
runs-on: ubuntu-latest
37+
if: github.ref == 'refs/heads/master' || github.event.pull_request
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: actions/setup-node@v2
42+
name: Use Node.js 12
43+
with:
44+
node-version: 12
45+
check-latest: true
46+
- name: Install doctoc-check
47+
run: |
48+
npm install -g doctoc
49+
cp README.md README.md.orig
50+
npm run doctoc
51+
diff -q README.md README.md.orig

.travis.yml

-32
This file was deleted.

0 commit comments

Comments
 (0)