Files
toutoukan/.github/workflows/main.yml
JACKYMYPERSON b98f88f110 Update main.yml
2025-09-16 00:40:03 +08:00

40 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Golang CI
on:
push:
branches: ["main"]
jobs:
test-go:
runs-on: centos-latest
steps:
- name: code-pull
uses: actions/checkout@v4
- name: setup-goenv
uses: actions/setup-go@v5
with:
go-version: '1.24.7'
- name: verify go mod
run: go mod verify
- name: go build
run: go build -v ./...
- name: go test
run: go test -v ./...
send-email:
runs-on: ubuntu-latest
steps:
- name: 检出代码仓库
uses: actions/checkout@v4
- name: 发送邮件
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.qq.com
server_port: 465
username: ${{ secrets.EMAIL_USER }}
password: ${{ secrets.EMAIL_PASS }}
subject: "推送仓库成功"
body: "通知有新的内容已推送到仓库「toutoukan」的main分支\n推送时间: $(date +'%Y-%m-%d %H:%M:%S')\n推送作者: $(git log -1 --pretty=format:'%an')\n提交信息: $(git log -1 --pretty=format:'%s')"
to: 1627832236@qq.com
from: ${{ secrets.EMAIL_USER }}
# 如果使用 SSL
secure: true