Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New translation batch for cn (#28808)
  • Loading branch information
docubot authored Jun 29, 2022
commit f1e73165c0093fdecc81b1f84b8ed6dff802bf76
6 changes: 6 additions & 0 deletions translations/log/cn-resets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/analyzin
translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/overview/about-enterprise-accounts.md,Listed in localization-support#489
translations/zh-CN/content/admin/overview/about-enterprise-accounts.md,rendering error
translations/zh-CN/content/admin/overview/about-github-enterprise-server.md,broken liquid tags
translations/zh-CN/content/admin/overview/creating-an-enterprise-account.md,broken liquid tags
translations/zh-CN/content/admin/packages/configuring-package-ecosystem-support-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/packages/enabling-github-packages-with-aws.md,broken liquid tags
Expand Down Expand Up @@ -156,6 +157,8 @@ translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scannin
translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/installing-codeql-cli-in-your-ci-system.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/running-codeql-runner-in-your-ci-system.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md,rendering error
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/browsing-security-advisories-in-the-github-advisory-database.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/index.md,broken liquid tags
Expand Down Expand Up @@ -185,6 +188,9 @@ translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/
translations/zh-CN/content/codespaces/the-githubdev-web-based-editor.md,broken liquid tags
translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-codespaces.md,broken liquid tags
translations/zh-CN/content/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam.md,broken liquid tags
translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code.md,broken liquid tags
translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio.md,broken liquid tags
translations/zh-CN/content/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio.md,broken liquid tags
translations/zh-CN/content/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/adding-an-existing-project-to-github-using-github-desktop.md,broken liquid tags
translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/about-git-large-file-storage-and-github-desktop.md,broken liquid tags
translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/about-connections-to-github.md,broken liquid tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ shortTitle: 您的个人资料自述文件

生成的自述文件用模板预先填充,为您创建个人资料自述文件提供一些启发。 ![带有预填充模板的自述文件](/assets/images/help/repository/personal-repository-readme-template.png)

有关所有可用表情符号及其代码的摘要,请参阅“[表情符号备忘清单](http://www.emoji-cheat-sheet.com/)” 。
有关所有可用表情符号及其代码的摘要,请参阅“[表情符号备忘清单](https://www.webfx.com/tools/emoji-cheat-sheet/)” 。

## 删除个人资料自述文件

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ shortTitle: 个性化

**注意{% ifversion ghec %}s{% endif %}**:{% ifversion ghec %}

* {% endif %}头像应为 1 MB 以下的 PNG、JPG 或 GIF 文件。 为获取质量最佳的渲染,建议图像的像素保持在大约 500 x 500 像素。
* {% endif %}您的头像应为 PNG、JPG 或 GIF 文件,并且其大小必须小于 1 MB 且小于 3000 x 3000 像素。 为获取质量最佳的渲染,建议图像的像素保持在大约 500 x 500 像素。
{% ifversion ghec %}* {% data variables.product.prodname_emus %} 不支持 Gravatar 头像。{% endif %}

{% endnote %}
Expand All @@ -39,14 +39,14 @@ shortTitle: 个性化

{% data reusables.user-settings.access_settings %}
2. 在 **Profile Picture(头像)**下,单击 {% octicon "pencil" aria-label="The edit icon" %} **Edit(编辑)**。 ![编辑头像](/assets/images/help/profile/edit-profile-photo.png)
3. 单击 **Upload a photo...(上传图片...)**。 ![更新头像](/assets/images/help/profile/edit-profile-picture-options.png)
3. 单击 **Upload a photo...(上传照片...)**。{% ifversion not ghae %} ![Update profile picture](/assets/images/help/profile/edit-profile-picture-options.png){% endif %}
3. 裁剪图片。 完成后,单击 **Set new profile picture(设置新头像)**。 ![裁剪上传的照片](/assets/images/help/profile/avatar_crop_and_save.png)

### 将头像重置为默认肖像

{% data reusables.user-settings.access_settings %}
2. 在 **Profile Picture(头像)**下,单击 {% octicon "pencil" aria-label="The edit icon" %} **Edit(编辑)**。 ![编辑头像](/assets/images/help/profile/edit-profile-photo.png)
3. 要还原为默认肖像,请单击 **Remove photo(删除照片)**。 如果您的电子邮件地址与[个人全球统一标识](https://en.gravatar.com/)关联,则无法还原到默认肖像。 此时请单击 **Revert to Gravatar(还原到个人全球统一标识)**。 ![更新头像](/assets/images/help/profile/edit-profile-picture-options.png)
3. 要还原为默认肖像,请单击 **Remove photo(删除照片)**。 {% ifversion not ghae %}如果您的电子邮件地址与[个人全球统一标识](https://en.gravatar.com/)关联,则无法还原到默认肖像。 此时请单击 **Revert to Gravatar(还原到个人全球统一标识)**。 ![Update profile picture](/assets/images/help/profile/edit-profile-picture-options.png){% endif %}

## 更改个人资料名称

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ shortTitle: 仓库权限
{% endif %}
| 自定义仓库的社交媒体预览 | "[自定义仓库的社交媒体预览](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" |
| 从仓库创建模板 | "[创建模板仓库](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% ifversion fpt or ghes or ghae or ghec %}
| Control access to {% data variables.product.prodname_dependabot_alerts %} | "[管理仓库的安全和分析设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %}
| 忽略仓库中的 {% data variables.product.prodname_dependabot_alerts %} | "[Viewing and updating {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)" |
| 控制对 {% data variables.product.prodname_dependabot_alerts %} 的访问 | "[管理仓库的安全和分析设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %}
| 忽略仓库中的 {% data variables.product.prodname_dependabot_alerts %} | “[查看和更新 {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts) |
| 管理私有仓库的数据使用 | “[管理私有仓库的数据使用设置](/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository)”
{% endif %}
| 定义仓库的代码所有者 | "[关于代码所有者](/github/creating-cloning-and-archiving-repositories/about-code-owners)" |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
---
title: Building and testing Go
intro: You can create a continuous integration (CI) workflow to build and test your Go project.
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
type: tutorial
topics:
- CI
shortTitle: Build & test Go
---

{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}

## 简介

This guide shows you how to build, test, and publish a Go package.

{% ifversion ghae %}
{% data reusables.actions.self-hosted-runners-software %}
{% else %} {% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with preinstalled software, which includes the dependencies for Go. For a full list of up-to-date software and the preinstalled versions of Go, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software)."
{% endif %}

## 基本要求

您应该已经熟悉 YAML 语法及其如何与 {% data variables.product.prodname_actions %} 结合使用。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/actions/using-workflows/workflow-syntax-for-github-actions)”。

We recommend that you have a basic understanding of the Go language. For more information, see [Getting started with Go](https://golang.org/doc/tutorial/getting-started).

## Using the Go starter workflow

{% data variables.product.prodname_dotcom %} provides a Go starter workflow that should work for most Go projects. 本指南包含可用于自定义入门工作流程的示例。 For more information, see the [Go starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/go.yml).

要快速开始,请将入门工作流程添加到仓库的 `.github/workflows` 目录中。

```yaml{:copy}
name: Go package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: {% data reusables.actions.action-checkout %}

- name: Set up Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
```

## Specifying a Go version

The easiest way to specify a Go version is by using the `setup-go` action provided by {% data variables.product.prodname_dotcom %}. For more information see, the [`setup-go` action](https://github.com/actions/setup-go/).

To use a preinstalled version of Go on a {% data variables.product.prodname_dotcom %}-hosted runner, pass the relevant version to the `go-version` property of the `setup-go` action. This action finds a specific version of Go from the tools cache on each runner, and adds the necessary binaries to `PATH`. 这些更改将持续用于作业的其余部分。

The `setup-go` action is the recommended way of using Go with {% data variables.product.prodname_actions %}, because it helps ensure consistent behavior across different runners and different versions of Go. If you are using a self-hosted runner, you must install Go and add it to `PATH`.

### Using multiple versions of Go

```yaml{:copy}
name: Go

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]

steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go {% raw %}${{ matrix.go-version }}{% endraw %}
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: {% raw %}${{ matrix.go-version }}{% endraw %}
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
```

### Using a specific Go version

You can configure your job to use a specific version of Go, such as `1.16.2`. 或者,您也可以使用语义版本语法来获得最新的次要版本。 This example uses the latest patch release of Go 1.16:

```yaml{:copy}
- name: Setup Go 1.16.x
uses: {% data reusables.actions.action-setup-go %}
with:
# Semantic version range syntax or exact version of Go
go-version: '1.16.x'
```

## 安装依赖项

You can use `go get` to install dependencies:

```yaml{:copy}
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
- name: Install dependencies
run: |
go get .
go get example.lab/octo-examplemodule
go get example.lab/[email protected]
```

{% ifversion actions-caching %}

### 缓存依赖项

You can cache and restore the dependencies using the [`setup-go` action](https://github.com/actions/setup-go). By default, caching is disabled, but you can set the `cache` parameter to `true` to enable it.

When caching is enabled, the `setup-go` action searches for the dependency file, `go.sum`, in the repository root and uses the hash of the dependency file as a part of the cache key.

```yaml{:copy}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
cache: true
```

Alternatively, you can use the `cache-dependency-path` parameter for cases when multiple dependency files are used, or when they are located in different subdirectories.

```yaml{:copy}
- uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.17'
cache: true
cache-dependency-path: subdir/go.sum
```

如果您有自定义要求或需要更精确的缓存控制,则可以使用 [`cache` 操作](https://github.com/marketplace/actions/cache)。 更多信息请参阅“[缓存依赖项以加快工作流程](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)”。

{% endif %}

## 构建和测试代码

您可以使用与本地相同的命令来构建和测试代码。 This example workflow demonstrates how to use `go build` and `go test` in a job:

```yaml{:copy}
name: Go
on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test
```

## 将工作流数据打包为构件

工作流程完成后,您可以上传产生的项目进行分析。 例如,您可能需要保存日志文件、核心转储、测试结果或屏幕截图。 下面的示例演示如何使用 `upload-artifact` 操作来上传测试结果。

For more information, see "[Storing workflow data as artifacts](/actions/using-workflows/storing-workflow-data-as-artifacts)."

```yaml{:copy}
name: Upload Go test results

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]

steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: {% raw %}${{ matrix.go-version }}{% endraw %}
- name: Install dependencies
run: go get .
- name: Test with Go
run: go test -json > TestResults-{% raw %}${{ matrix.go-version }}{% endraw %}.json
- name: Upload Go test results
uses: {% data reusables.actions.action-upload-artifact %}
with:
name: Go-results-{% raw %}${{ matrix.go-version }}{% endraw %}
path: TestResults-{% raw %}${{ matrix.go-version }}{% endraw %}.json
```
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
# You can use PyPy versions in python-version.
# For example, {% ifversion actions-node16-action %}pypy-2.7 and pypy-3.8{% else %}pypy2 and pypy3{% endif %}
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand All @@ -129,7 +129,7 @@ jobs:

### 使用特定的 Python 版本

您可以配置 python 的特定版本。 例如,3.8。 或者,您也可以使用语义版本语法来获得最新的次要版本。 此示例使用 Python 3 最新的次要版本。
您可以配置 python 的特定版本。 例如,3.9。 或者,您也可以使用语义版本语法来获得最新的次要版本。 此示例使用 Python 3 最新的次要版本。

```yaml{:copy}
name: Python package
Expand Down Expand Up @@ -173,12 +173,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", {% ifversion actions-node16-action %}pypy-2.7, pypy-3.8{% else %}pypy2, pypy3{% endif %}]
python-version: ["3.7", "3.8", "3.9", "3.10", {% ifversion actions-node16-action %}pypy-2.7, pypy-3.8{% else %}pypy2, pypy3{% endif %}]
exclude:
- os: macos-latest
python-version: "3.6"
python-version: "3.7"
- os: windows-latest
python-version: "3.6"
python-version: "3.7"
```

### 使用默认 Python 版本
Expand Down Expand Up @@ -238,7 +238,7 @@ steps:
- uses: {% data reusables.actions.action-checkout %}
- uses: {% data reusables.actions.action-setup-python %}
with:
python-version: '3.9'
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- run: pip test
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9"]
python: ["3.8", "3.9", "3.10"]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand Down Expand Up @@ -347,7 +347,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand Down
Loading