Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

chore(workflow): add release and test workflows #187

Closed
wants to merge 13 commits into from
Closed
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- main

jobs:
checkCommit:
name: Check Commit
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- id: commit
run: echo "::set-output name=message::${{ github.even.head_commit.message }}"
outputs:
commitMessage: ${{ steps.commit.outputs.message }}
release:
name: Release
needs: [checkCommit]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Test Packages
run: npm run test
- name: Release Packages
env:
NODE_ENV: production
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |-
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
npm run lerna:deploy -- "${{ need.checkCommit.outputs.commitMsg }}"
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,35 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '10.x', '12.x', '14.x' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Unit Tests
run: npm test
- name: Git History Test
run: npm run test:git-history
- name: Lockfile Lint Test
run: npm run test:lockfile
- name: Lint
run: npm run test:lint
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.