Skip to content

Commit

Permalink
chore: set up GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Sep 16, 2020
1 parent 54ea30c commit be5672f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

jobs:
test:
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
strategy:
matrix:
os: [ubuntu-latest]
node: ['12']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: |
npm ci
npm t
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,38 @@
name: Docs

on:
push:
branches:
- master
workflow_dispatch:

jobs:
docs:
name: Publish docs / OS ${{ matrix.os }} / Node ${{ matrix.node }}
strategy:
matrix:
os: [ubuntu-latest]
node: ['12']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- run: |
npm ci
npm run docs
npm run docs:json
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
force_orphan: true
commit_message: 'docs: update'
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- master
workflow_dispatch:

jobs:
release:
name: Release / Node ${{ matrix.node }}
strategy:
matrix:
node: ['12']

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- run: |
npm ci
npm run build
- name: Create a release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -22,9 +22,10 @@
"build": "run-s clean format build:*",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"test": "run-s test:db && jest",
"test:db": "cd test/db && docker-compose down && docker-compose up -d && sleep 3",
"docs": "typedoc --mode file --target ES6 --theme minimal"
"test": "run-s test:db && jest -i",
"test:db": "cd test/db && docker-compose down && docker-compose up -d && sleep 5",
"docs": "typedoc --mode file --target ES6 --theme minimal",
"docs:json": "typedoc --json docs/spec.json --mode modules --includeDeclarations --excludeExternals"
},
"dependencies": {
"isomorphic-unfetch": "^3.0.0"
Expand Down

0 comments on commit be5672f

Please sign in to comment.