Skip to content

Commit 3c9ee0d

Browse files
committed
Add GitHub actions for validation
1 parent 0aca162 commit 3c9ee0d

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
pull_request: {}
3+
push:
4+
branches: [main]
5+
6+
name: Lint
7+
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: ^18.6.0
18+
cache: yarn
19+
cache-dependency-path: |
20+
yarn.lock
21+
- name: Get yarn cache directory path
22+
id: yarn-cache-dir-path
23+
run: |
24+
echo dir="$(yarn cache dir)" >> $GITHUB_OUTPUT
25+
echo version="$(yarn cache dir)" >> $GITHUB_OUTPUT
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
**/node_modules
30+
${{ steps.yarn-cache-dir-path.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ steps.yarn-cache-dir-path.outputs.version }}-${{ hashFiles('**/yarn.lock') }}
32+
- name: Yarn install
33+
run: yarn install
34+
- name: Verify format
35+
run: yarn prettier --check .
36+
- name: Lint
37+
run: yarn run eslint --max-warnings 0 .

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
pull_request: {}
3+
push:
4+
branches: [main]
5+
6+
name: Test
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: ^18.6.0
18+
cache: yarn
19+
cache-dependency-path: |
20+
yarn.lock
21+
- name: Get yarn cache directory path
22+
id: yarn-cache-dir-path
23+
run: |
24+
echo dir="$(yarn cache dir)" >> $GITHUB_OUTPUT
25+
echo version="$(yarn cache dir)" >> $GITHUB_OUTPUT
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
**/node_modules
30+
${{ steps.yarn-cache-dir-path.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ steps.yarn-cache-dir-path.outputs.version }}-${{ hashFiles('**/yarn.lock') }}
32+
- name: Yarn install
33+
run: yarn install
34+
- name: Run tests
35+
run: yarn jest -w2

0 commit comments

Comments
 (0)