-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.84 KB
/
check.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: check
on:
push:
branches:
- main
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
test-windows:
runs-on: windows-latest
env:
WECOM_ROBOT_KEY: ${{ secrets.WECOM_ROBOT_KEY }}
steps:
- uses: actions/checkout@v4
- name: install (windows)
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: moon version
run: |
moon version --all
moonrun --version
- name: update mooncakes registry
run: moon update
- name: simple use
run: |
Get-ChildItem -Filter *.ps1 | ForEach-Object {
PowerShell -File $_.FullName
}
- name: notify on fail
if: ${{ failure() }}
run: |
$body = @{
msgtype = "text"
text = @{
content = "🤣 daily ci on windows-latest failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{github.run_id}}"
}
} | ConvertTo-Json
Invoke-RestMethod -Uri "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=$env:WECOM_ROBOT_KEY" -Method Post -ContentType "application/json" -Body $body
test-unix:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
runs-on: ${{ matrix.os }}
env:
WECOM_ROBOT_KEY: ${{ secrets.WECOM_ROBOT_KEY }}
steps:
- uses: actions/checkout@v4
- name: install (unix)
if: ${{ matrix.os != 'windows-latest' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: install (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: moon version
run: |
moon version --all
moonrun --version
- name: update mooncakes registry
run: moon update
- name: simple use
run: |
for i in *.sh; do
bash $i
done
- name: notify on fail
if: ${{ failure() }}
run: |
curl "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=$WECOM_ROBOT_KEY" \
-H 'Content-Type: application/json' \
-d @- <<REQUEST_BODY
{
"msgtype": "text",
"text": {
"content": "🤣 daily ci on ${{matrix.os}} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
REQUEST_BODY