Skip to content

Commit 525263b

Browse files
authored
Merge pull request #2 from Code-Hex/add/ci
added ci
2 parents bf70d86 + ea05e5d commit 525263b

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup Node
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: 17
16+
- name: Cache Yarn
17+
uses: actions/cache@v2
18+
with:
19+
path: '**/node_modules'
20+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
21+
restore-keys: |
22+
${{ runner.os }}-yarn-
23+
- run: yarn install --frozen-lockfile
24+
- run: yarn test
25+
env:
26+
CI: true
27+
eslint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Setup Node
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: 18
35+
- name: Cache Yarn
36+
uses: actions/cache@v2
37+
with:
38+
path: '**/node_modules'
39+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-yarn-
42+
- run: yarn install --frozen-lockfile
43+
- run: yarn lint-fix
44+
- run: yarn prettier
45+
- name: Auto commit fixed code
46+
id: auto-commit-action
47+
uses: stefanzweifel/git-auto-commit-action@v4
48+
with:
49+
commit_message: Apply auto lint-fix changes
50+
branch: ${{ github.head_ref }}
51+
- name: eslint
52+
if: steps.auto-commit-action.outputs.changes_detected == 'false'
53+
uses: reviewdog/action-eslint@v1
54+
with:
55+
level: warning
56+
reporter: github-pr-review

0 commit comments

Comments
 (0)