Skip to content

Commit 1266025

Browse files
authored
ci: add github actions (#11)
1 parent 9382ec1 commit 1266025

File tree

4 files changed

+82
-22
lines changed

4 files changed

+82
-22
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
Runner:
12+
timeout-minutes: 10
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Git Source
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Docker
19+
uses: docker-practice/actions-setup-docker@1.0.9
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '16'
25+
26+
- name: Install dependencies
27+
run: |
28+
npm i npm@6 -g
29+
npm i
30+
31+
- name: Continuous integration
32+
run: |
33+
npm run lint
34+
docker run -i --entrypoint=bash -v `pwd`:/root/tmp --rm macacajs/macaca-electron-docker-ubuntu -c "cd /root/tmp && ./test/ci.sh"
35+
36+
- name: Code coverage
37+
uses: codecov/codecov-action@v3.0.0
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs-build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docs Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
docs-build:
12+
timeout-minutes: 10
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Git Source
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '16'
25+
26+
- name: Install dependencies
27+
run: |
28+
npm i npm@6 -g
29+
npm install jsdoc -D
30+
npm install minami -D
31+
32+
- name: Build docs
33+
run: npm run doc
34+
35+
- name: Deploy to GitHub Pages
36+
if: success()
37+
uses: peaceiris/actions-gh-pages@v3
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_dir: ./docs

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
---
44

55
[![NPM version][npm-image]][npm-url]
6-
[![build status][travis-image]][travis-url]
6+
[![CI][CI-image]][CI-url]
77
[![Test coverage][coveralls-image]][coveralls-url]
88
[![node version][node-image]][node-url]
99

1010
[npm-image]: https://img.shields.io/npm/v/macaca-puppeteer.svg
1111
[npm-url]: https://npmjs.org/package/macaca-puppeteer
12-
[travis-image]: https://img.shields.io/travis/macacajs/macaca-puppeteer.svg
13-
[travis-url]: https://travis-ci.org/macacajs/macaca-puppeteer
12+
[CI-image]: https://github.com/macacajs/macaca-puppeteer/actions/workflows/ci.yml/badge.svg
13+
[CI-url]: https://github.com/macacajs/macaca-puppeteer/actions/workflows/ci.yml
1414
[coveralls-image]: https://img.shields.io/coveralls/macacajs/macaca-puppeteer.svg
1515
[coveralls-url]: https://coveralls.io/r/macacajs/macaca-puppeteer?branch=master
1616
[node-image]: https://img.shields.io/badge/node.js-%3E=_8-green.svg

0 commit comments

Comments
 (0)