mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-08-28 11:46:02 +08:00
* Adds Lerna and merges control plane repo * Re-adds `npm run start` as access pattern * Fixes eslint rules for react * Tweaks to Dockerfiles * Tweak to test runner
78 lines
1.7 KiB
YAML
78 lines
1.7 KiB
YAML
name: Test
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [16.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Node Install
|
|
run: |
|
|
npm install
|
|
- name: Lint
|
|
run: |
|
|
npm run lint
|
|
|
|
test:
|
|
needs: lint
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [16.x]
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:8.0.27
|
|
env:
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
|
|
MYSQL_DATABASE: 'parcelvoy'
|
|
ports:
|
|
- 3306:3306
|
|
options: >-
|
|
--tmpfs="/var/lib/mysql"
|
|
--health-cmd="mysqladmin ping"
|
|
--health-interval=10s
|
|
--health-timeout=5s
|
|
--health-retries=3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Node 16.x
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.x
|
|
|
|
- name: Cache NPM
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install Dependencies
|
|
run: npm install && npm install --save-dev
|
|
|
|
- name: 'Run Jest Tests'
|
|
run: npm run test -- --scope=platform
|
|
env:
|
|
NODE_ENV: test
|
|
APP_SECRET: ${{ secrets.APP_SECRET }}
|
|
DB_CLIENT: mysql2
|
|
DB_DATABASE: parcelvoy
|
|
DB_USERNAME: root
|
|
DB_PORT: 3306
|
|
APP_BASE_URL: https://parcelvoy.com
|
|
QUEUE_DRIVER: memory
|
|
STORAGE_DRIVER: s3
|