check #244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |