Skip to content

Commit

Permalink
ci: add github actions (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapre authored Apr 15, 2022
1 parent 5734de1 commit 790f69e
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 28 deletions.
17 changes: 17 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
titleOnly: true
types:
- feat
- fix
- docs
- dx
- refactor
- perf
- test
- workflow
- build
- ci
- chore
- types
- wip
- release
- deps
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
# allows to manually run the job at any time
workflow_dispatch:

push:
branches:
- '**'

jobs:
test:
name: 'Run Unit Test: node-16, ubuntu-latest'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup docker
uses: docker-practice/[email protected]

- name: Docker pull macacajs/reliable-mysql
run: |
docker pull macacajs/reliable-mysql
docker run --rm --name reliable-mysql -p 13306:3306 -d macacajs/reliable-mysql
docker ps -a
- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install deps
run: npm install

- name: Run ci
run: npm run ci
env:
MYSQL_PORT: 13306

- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs Build

on:
# allows to manually run the job at any time
workflow_dispatch:

# run on every push on the master branch
push:
branches:
- master

jobs:
docs-build:
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install deps
run: |
npm install vuepress -D
npm install macaca-ecosystem -D
- name: Build docs
run: npm run docs:build

- name: Deploy to GitHub Pages
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs_dist
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
---

[![build status][travis-image]][travis-url]
[![CI][CI-image]][CI-url]
[![Test coverage][codecov-image]][codecov-url]
[![node version][node-image]][node-url]
[![docker pull][docker-pull-image]][docker-url]
[![docker layers][docker-layers-image]][docker-url]
[![docker-size][docker-size-image]][docker-url]

[travis-image]: https://travis-ci.com/macacajs/reliable.svg?branch=master
[travis-url]: https://travis-ci.com/macacajs/reliable
[CI-image]: https://github.com/macacajs/reliable/actions/workflows/ci.yml/badge.svg
[CI-url]: https://github.com/macacajs/reliable/actions/workflows/ci.yml
[codecov-image]: https://img.shields.io/codecov/c/github/macacajs/reliable/master.svg
[codecov-url]: https://codecov.io/gh/macacajs/reliable
[node-image]: https://img.shields.io/badge/node.js-%3E=_12-green.svg
Expand Down

0 comments on commit 790f69e

Please sign in to comment.