CI: configure Github Actions

Signed-off-by: Jesse Chan <jc@linux.com>
This commit is contained in:
Jesse Chan
2020-08-04 16:15:55 +08:00
parent 39b4430904
commit 52535e1eab
4 changed files with 92 additions and 0 deletions

23
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: cp config.template.js config.js
- run: npm install
- run: npm run build

View File

@@ -0,0 +1,23 @@
name: Check source formatting
on: [push, pull_request]
jobs:
check-source-formatting:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: cp config.template.js config.js
- run: npm install
- run: npm run check-source-formatting

23
.github/workflows/check-types.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Check types
on: [push, pull_request]
jobs:
check-types:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: cp config.template.js config.js
- run: npm install
- run: npm run check-types

23
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: cp config.template.js config.js
- run: npm install
- run: npm run lint