-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.42 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
name: Check code
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check-code:
name: Check code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm i
- name: Check build:ts
run: npm run build:ts
- name: Check test:ts
run: npm run test:ts:ci 2> jest-test.local.log
- name: Prepare report
if: ${{ failure() && github.event_name == 'pull_request' }}
run: |
sed -i '1i\```' jest-test.local.log
sed -i '1i\## Jest Test Errored Report' jest-test.local.log
echo '```' >> jest-test.local.log
sed -ir "s/\x1B\[[0-9;]*[JKmsu]//g" jest-test.local.log
cat jest-test.local.log
- name: Find Comment
uses: peter-evans/find-comment@v3
if: ${{ failure() && github.event_name == 'pull_request' }}
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: 'Jest Test Errored Report'
- name: Comment configurate
uses: GrantBirki/comment@v2
if: ${{ failure() && github.event_name == 'pull_request' }}
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
file: jest-test.local.log
edit-mode: replace