-
Notifications
You must be signed in to change notification settings - Fork 39
78 lines (61 loc) · 2.09 KB
/
test.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
75
76
77
78
name: test
on:
push:
branches:
- 'main'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: start build notification
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
format: html
message: |
⏳ <a href="${{ github.server_url }}/${{ github.repository }}"><b>${{ github.repository }}</b></a>
${{ github.workflow }}
by: ${{ github.actor }}
branch: ${{ github.ref }}
commit: ${{ github.event.head_commit.message }}
sha: ${{ steps.vars.outputs.sha_short }}
<a href="${{ github.event.head_commit.url }}">link</a>
- name: install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: install node
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- name: install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: build
run: pnpm build
- name: test
run: pnpm test
- name: finish build notification
uses: appleboy/telegram-action@master
if: always()
with:
to: ${{ secrets.TELEGRAM_CHAT }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
format: html
message: |
${{ job.status == 'success' && '✅' || '🆘' }} <a href="${{ github.server_url }}/${{ github.repository }}"><b>${{ github.repository }}</b></a>
${{ github.workflow }}
by: ${{ github.actor }}
branch: ${{ github.ref }}
commit: ${{ github.event.head_commit.message }}
sha: ${{ steps.vars.outputs.sha_short }}
<a href="${{ github.event.head_commit.url }}">link</a>