Skip to content

Commit

Permalink
try add github action config
Browse files Browse the repository at this point in the history
  • Loading branch information
bolasblack committed Aug 1, 2020
1 parent d2d9268 commit 1ef7e43
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on: [push, pull_request]

env:
YARN_CACHE_FOLDER: ~/.yarn-cache

jobs:
test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.yarn-cache
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn

- name: Lint
run: yarn lerna run lint

- name: Test
run: yarn lerna run test
1 change: 1 addition & 0 deletions packages/start/lib-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"start": "lib/cli.js"
},
"scripts": {
"lint": "exit 0",
"test": "exit 0",
"prepublishOnly": "node src/require.js build",
"start": "node src/require.js"
Expand Down
3 changes: 2 additions & 1 deletion packages/toolconfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"author": "c4605 <bolasblack@gmail.com>",
"license": "MIT",
"scripts": {
"test": "eslint ./**/*.js"
"lint": "eslint ./**/*.js",
"test": "exit 0"
},
"peerDependencies": {
"@commitlint/config-conventional": "^8.3.4",
Expand Down
1 change: 1 addition & 0 deletions packages/ts-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"license": "MIT",
"scripts": {
"start": "yarn test && nodemon -w src/**/*.ts -w dtslint/**/*.ts --exec 'yarn test'",
"lint": "exit 0",
"test": "dtslint --onlyTestTsNext dtslint"
},
"peerDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/yarw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"author": "c4605 <bolasblack@gmail.com>",
"license": "MIT",
"scripts": {
"test": "yarn test:lint && yarn test:jest",
"test:lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
"test:jest": "NODE_ENV=test jest --no-cache src",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
"test": "NODE_ENV=test jest --no-cache src",
"prepublishOnly": "start build",
"build": "start build"
},
Expand Down

0 comments on commit 1ef7e43

Please sign in to comment.