fix(tools): add node.js CI tests
This commit is contained in:
65
.github/workflows/node.js-tests.yml
vendored
Normal file
65
.github/workflows/node.js-tests.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: Node.js CI
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- production-**
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [12.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source Files
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Lint Source Files
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run ensure-env --if-present
|
||||||
|
npm run lint --if-present
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Check Builds and Run Integration Tests
|
||||||
|
needs: lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [12.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source Files
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Set Environment variables
|
||||||
|
run: cp sample.env .env
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run ensure-env --if-present
|
||||||
|
|
||||||
|
- name: Build Packages
|
||||||
|
run: npm run build --if-present
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: npm test
|
Reference in New Issue
Block a user