diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..2511b79 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,17 @@ +titleOnly: true +types: + - feat + - fix + - docs + - dx + - refactor + - perf + - test + - workflow + - build + - ci + - chore + - types + - wip + - release + - deps diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..41b3df0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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/actions-setup-docker@1.0.9 + + - 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/codecov-action@v3.0.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml new file mode 100644 index 0000000..62feb21 --- /dev/null +++ b/.github/workflows/docs-build.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 335cada..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false - -language: node_js - -services: - - docker - -node_js: - - 12 - -before_install: - - docker pull macacajs/reliable-mysql - - docker run --rm --name reliable-mysql -p 13306:3306 -d macacajs/reliable-mysql - - docker ps -a - -install: - - npm i - -script: - - npm run docs:build - - $(npm bin)/macaca-ecosystem push --cwd ./docs_dist --branch gh-pages - - cd ./docs_dist - - MYSQL_PORT=13306 npm run ci - -after_script: - - npm i codecov && $(npm bin)/codecov diff --git a/README.md b/README.md index 4f017b6..7018123 100644 --- a/README.md +++ b/README.md @@ -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