type
status
date
slug
summary
tags
category
icon
password
对一个新的 Go 项目配置单元测试的 Workflow,项目为:
llmplugin
Github
llmplugin
Owner
agi-cn
Updated
Jun 8, 2023
 

Workflow 配置文件

在工程目录下,创建文件:`.github/workflow/go.yml` 文件,内容如下,
 
根据配置文件会有下列关键任务,
  • Set up Go: 设置 Go 的版本为 1.20.3
  • Run tests: 运行单元测试。这里需要注意的是获取环境变量(下面详细介绍环境变量的设置)
  • Notify reviewer if tests pass: 当单元测试成功后,在这里可以添加消息通知。
 

环境变量

由于我需要设置的环境变量涉及到密码,所以我不希望被明文显示。
按照下列步骤进行环境变量设置:
notion image
 
  1. 打开 Settings
  1. 左侧边框 Secrets and variables,选择 Actions
  1. 点击 New repository secret ,添加对应的环境变量。
  1. 添加成功后,在 Repository secrets 中展示。
 

运行结果

打开 Actions,能看到对应的 Workflow 成功运行。
notion image
 
对于 Pull Request 中,也可以看到配置的 workflow 是否成功。
notion image
 
HeadScale 管理虚拟机Cloudflare Warp 配置
Loading...