Skip to content

Commit f60b80e

Browse files
authored
Create .github/workflows/main.yml
1 parent bdb3da1 commit f60b80e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/node.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: TypeScript CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
preCheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Filter path
18+
uses: dorny/paths-filter@v2
19+
id: filter
20+
with:
21+
filters: |
22+
srcPath:
23+
- 'src/**'
24+
outputs:
25+
isExecute: ${{ steps.filter.outputs.srcPath }}
26+
unitTest:
27+
needs: preCheck
28+
if: ${{ needs.preCheck.outputs.isExecute == 'true' }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Commit records
35+
run: |
36+
echo "THE LAST COMMIT RECORDS"
37+
git log --pretty=format:'%Cgreen%h %Creset| %Cblueauthor: %Cred%<(15,trunc)%an %Creset| %Cbluecommitter: %Cred%<(15,trunc)%cn %Creset| %Cbluedate: %Cred%ad %Creset| %Cbluemessage: %Cred%<(60,trunc)%s' --date=format:'%Y-%m-%d %H:%M:%S' -1
38+
39+
- name: Setup node
40+
uses: actions/setup-node@v1
41+
with:
42+
node-version: '14.x'
43+
44+
- name: Setup pnpm
45+
uses: pnpm/[email protected]
46+
with:
47+
version: 7.12.2
48+
49+
- name: Install dependencies
50+
run: |
51+
pnpm install
52+
53+
- name: Run tests
54+
run: |
55+
pnpm run coverage
56+
ls -al coverage
57+
58+
- name: Upload coverage to codecov
59+
run: curl -s https://codecov.io/bash | bash

0 commit comments

Comments
 (0)