Skip to content

Commit ef85b46

Browse files
committed
CI
1 parent f4031e1 commit ef85b46

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 16
18+
- uses: actions/cache@v3
19+
id: node_modules_cache_id
20+
env:
21+
cache-name: cache-node-modules
22+
with:
23+
path: node_modules
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
- if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
26+
run: npm ci
27+
28+
- name: ESLint
29+
run: npm run lint
30+
- name: Prettier
31+
run: npm run format
32+
- name: Test
33+
run: npm run test

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"description": "A plugin for ESLint to keep order of component names",
55
"main": "index.js",
66
"scripts": {
7+
"format": "prettier --check ./**/*.js",
8+
"lint": "eslint .",
79
"test": "mocha tests/",
810
"test:watch": "mocha --watch --reporter min tests/"
911
},

0 commit comments

Comments
 (0)