-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.51 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
name: test
on:
schedule:
- cron: '0 */4 * * *'
jobs:
test-job:
name: run npm test
runs-on: ubuntu-latest
if: false
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- name: Install dependencies
run: npm install --force
- name: Run test script
run: npm test
- name: Send failed message to wx
env:
WX_PUSHER_TOKEN: ${{ secrets.WX_PUSHER_TOKEN }}
WX_PUSHER_UID: ${{ secrets.WX_PUSHER_UID }}
WX_PUSHER_APPID: ${{ secrets.WX_PUSHER_APPID }}
if: ${{ failure() }}
run: |
run_no=${{ github.run_number }}
run_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
curl 'https://wxpusher.zjiecode.com/api/send/message' \
-X POST \
-H 'Accept: */*' \
-H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Pragma: no-cache' \
--data-raw '{"appId":"'"$WX_PUSHER_APPID"'","appToken":"'"$WX_PUSHER_TOKEN"'","uids":["'"$WX_PUSHER_UID"'"],"topicIds":[],"url":"'"$run_url"'","summary":"MiniBili测试报错:#'"$run_no"'","content":"<p>#'"$run_no"'测试失败</p>","contentType":2,"verifyPay":false}' \
--compressed