-
Notifications
You must be signed in to change notification settings - Fork 13
74 lines (69 loc) · 1.97 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: "CI"
on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Setup project
run: |
npm install
npm run package
- name: Check lint
run: |
npm run lint
semver-title:
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request')
permissions:
pull-requests: write
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit-test:
runs-on: windows-latest
permissions:
pull-requests: write
steps:
- name: checkout PR
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Merge Branches
if: ${{ github.event_name == 'pull_request' }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "bot"
git remote add ${{ github.event.pull_request.base.repo.owner.login }} ${{ github.event.pull_request.base.repo.clone_url }}
git fetch ${{ github.event.pull_request.base.repo.owner.login }}
git merge ${{ github.event.pull_request.base.repo.owner.login }}/${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: run test
run: |
npm install
npm run test
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODE_COV }}
fail_ci_if_error: true
verbose: true