steps: -uses:actions/checkout@v4-uses:actions/setup-go@v5with:go-version:'>=1.17.0'-run:go version Note: Due to the peculiarities of YAML parsing, it is recommended to wrap the version in single quotation marks: go-version:'1.20' ...
在项目目录 /.github/.workflows/go.yml 配置yml自动部署,当push到github时,自动构建项目,并将构建的可运行程序通过ssh上传到自己的服务器。 name:Goon:push:branches:["master"]pull_request:branches:["master"]jobs:build:runs-on:ubuntu-lateststeps:# 设置 Go 环境-name:设置Gouses:actions/setup-go@v4with...
name: Goon: push: branches: [ master ] pull_request: branches: [ master ]jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Set up Go 1.x uses: actions/setup-go@v2 with: go-version: ^1.13 id: go - name: Check out code into ...
steps:- name: Setup Go uses: actions/setup-go@v1 with: go-version: ${{ matrix.go }} id: go它使用 actions/setup-go[16] action 来安装我们指定的 Go 版本。这很酷。实际上,我几乎立刻就看到了使用多个 Go 版本运行 测试的好处,因为 Go 1.13 增 加了一些新功能,我的一些测试代码已...
GitHub Actions Pipeline 当我们把代码推送到 GitHub 上去过后,在页面上可以看到 Actions 的入口(前提是已经开通了): 在页面中可以看到 Actions 为我们提供了很多内置的 workflow,比如 golang、Rust、Python、Node 等等,我们这里来自己编写 workflow,点击右上角的 Setup a workflow yourself,跳转到 Pipeline 的编写页面...
- name:SetupGouses: actions/setup-go@v2with:go-version:'1.16' -name:Buildprojectrun:gobuild./... -name: Run testsrun:gotest./... 该YAML程序定义了一个名为"Go Workflow"的工作流程,用于Go项目。 该工作流程定义了两个触发事件:push和pull_request在主分支上。这意味着每当主分支上有push或pull ...
步骤1:安装Go环境。 在runner服务器上安装go,在这一步中,只需要使用现有的Github操作,即setup-go @ v2。 steps:-name:SetupGo1.xuses:actions/setup-go@v2with:go-version:^1.15id:go 使用with关键字为该操作提供输入参数。 在这里,要求它使用特定版本的Go,例如1.15版。
周末的时候,我决定将我 Go 语言的开源项目Flipt的 CI 流程从 TravisCI 转移到 GitHub Actions,我想要替换我现有的 CI,并尝试使用新的 GitHub Actions 将手动发版过程自动化。 说明:我在 GitHub 工作,但不在 Actions 团队。我想在我的开源项目中配置 Actions,并且不从 Actions 团队或 GitHub 的任何人那里获得任何...
name: Build on: push: branches: [ master ] jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Set up Go 1.14 uses: actions/setup-go@v1 with: go-version: 1.14 - name: Check out code into the Go module directory uses: actions/checkout@v2 - uses: shaowenchen/debugger...
name:CIon:push:branches:[main ]pull_request:branches:[main ]jobs:build:name:Buildruns-on:ubuntu-lateststeps:-name:Set up Gouses:actions/setup-go@v2with:go-version:^1.13-name:Check out code into the Go module directoryuses:actions/checkout@v2-name:Testrun:go test -v ./... ...