From 64ecd646f6dff36f1e191399c04765eec0424837 Mon Sep 17 00:00:00 2001 From: Arnaud Zheng Date: Thu, 2 Jun 2022 23:28:04 +0200 Subject: [PATCH] ci: move to github actions (#276) --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++ .github/workflows/npm-publish.yml | 36 +++++++++++++++++++++++++++++++ renovate.json | 5 ++--- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eb9c7d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: + - 'develop' + pull_request: + types: [review_requested, ready_for_review] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - run: yarn install --frozen-lockfile + - run: yarn run lint + - run: yarn run build + - run: yarn run test:coverage:report diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..7ca4ff6 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,36 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + push: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn install --frozen-lockfile + - run: yarn run lint + - run: yarn run build + - run: yarn run test + + publish-npm: + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: yarn install --frozen-lockfile + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/renovate.json b/renovate.json index f45d8f1..6be1e4d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,4 @@ { - "extends": [ - "config:base" - ] + "extends": ["config:base"], + "reviewers": ["arnaud-zg"] }