Skip to content

Repo sync #28429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 11 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
"GitHub.copilot",
"GitHub.copilot-chat"
]
},
"codespaces": {
"repositories": {
// allow Codespaces to pull from separate repo when user has access
"github/docs-early-access": {
"permissions": {
"contents": "write"
}
}
}
}
},

Expand All @@ -52,7 +62,7 @@

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",

"hostRequirements": {
"memory": "8gb"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,59 @@ You should already be familiar with YAML syntax and how it's used with {% data v

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
## Using a Go starter workflow

{% data variables.product.prodname_dotcom %} provides a Go starter workflow that should work for most Go projects. This guide includes examples that you can use to customize the starter workflow. For more information, see the [Go starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/go.yml).
{% data reusables.actions.starter-workflow-get-started %}

To get started quickly, add the starter workflow to the `.github/workflows` directory of your repository.
{% data variables.product.prodname_dotcom %} provides a Go starter workflow that should work for most Go projects. The subsequent sections of this guide give examples of how you can customize this starter workflow.

```yaml copy
name: Go package
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.actions-tab %}
{% data reusables.actions.new-starter-workflow %}
1. The "{% ifversion actions-starter-template-ui %}Choose a workflow{% else %}Choose a workflow template{% endif %}" page shows a selection of recommended starter workflows. Search for "go".
1. Filter the selection of workflows by clicking **Continuous integration**.
1. On the "Go - by {% data variables.product.prodname_actions %}" workflow, click {% ifversion actions-starter-template-ui %}**Configure**{% else %}**Set up this workflow**{% endif %}.

on: [push]
![Screenshot of the "Choose a workflow" page. The "Configure" button on the "Go" workflow is highlighted with an orange outline.](/assets/images/help/actions/starter-workflow-go.png)

jobs:
build:
{%- ifversion ghes or ghae %}
If you don't find the "Go - by {% data variables.product.prodname_actions %}" starter workflow, copy the following workflow code to a new file called `go.yml` in the `.github/workflows` directory of your repository.

runs-on: ubuntu-latest
steps:
- uses: {% data reusables.actions.action-checkout %}
```yaml copy
name: Go

- name: Set up Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.15'
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

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

- name: Test
run: go test -v ./...
```
runs-on: self-hosted
steps:
- uses: {% data reusables.actions.action-checkout %}

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

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

- name: Test
run: go test -v ./...
```
{%- endif %}

1. Edit the workflow as required. For example, change the version of Go.
1. Click **Commit changes**.

{% ifversion fpt or ghec %}
The `go.yml` workflow file is added to the `.github/workflows` directory of your repository.
{% endif %}

## Specifying a Go version

Expand All @@ -80,7 +104,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]
go-version: [ '1.19', '1.20', '1.21.x' ]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand All @@ -95,14 +119,14 @@ jobs:

### Using a specific Go version

You can configure your job to use a specific version of Go, such as `1.16.2`. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest patch release of Go 1.16:
You can configure your job to use a specific version of Go, such as `1.20.8`. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest patch release of Go 1.21:

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

## Installing dependencies
Expand All @@ -115,7 +139,7 @@ You can use `go get` to install dependencies:
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
go-version: '1.21.x'
- name: Install dependencies
run: |
go get .
Expand Down Expand Up @@ -150,7 +174,7 @@ When caching is enabled, the `setup-go` action searches for the dependency file,
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
go-version: '1.21.x'
cache: true
```

Expand Down Expand Up @@ -187,7 +211,7 @@ jobs:
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
go-version: '1.21.x'
- name: Install dependencies
run: go get .
- name: Build
Expand All @@ -213,7 +237,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]
go-version: [ '1.19', '1.20', '1.21.x' ]

steps:
- uses: {% data reusables.actions.action-checkout %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ topics:
- Java
- Ant
shortTitle: Build & test Java & Ant
layout: inline
---

{% data reusables.actions.enterprise-github-hosted-runners %}
Expand All @@ -40,39 +39,53 @@ We recommend that you have a basic understanding of Java and the Ant framework.

{% data reusables.actions.enterprise-setup-prereq %}

## Using the Ant starter workflow

{% data variables.product.prodname_dotcom %} provides an Ant starter workflow that will work for most Ant-based Java projects. For more information, see the [Ant starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/ant.yml). {% data reusables.actions.workflows.starter-workflows %}

To get started quickly, you can choose the preconfigured Ant starter workflow when you create a new workflow. For more information, see the "[AUTOTITLE](/actions/quickstart)."

You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.

```yaml annotate copy
# {% data reusables.actions.workflows.workflow-syntax-name %}
name: Java CI

#
on: [push]
#
jobs:
build:
{% data reusables.actions.example-github-runner-comment %}
runs-on: ubuntu-latest
#
steps:
{% data reusables.actions.workflows.workflow-checkout-step-explainer %}
- uses: {% data reusables.actions.action-checkout %}
{% data reusables.actions.workflows.setup-java-step-explainer %}
- name: Set up JDK 17
uses: {% data reusables.actions.action-setup-java %}
with:
java-version: '17'
distribution: 'temurin'
# This step runs the default target in your `build.xml` file in non-interactive mode.
- name: Build with Ant
run: ant -noinput -buildfile build.xml
```
## Using an Ant starter workflow

{% data reusables.actions.starter-workflow-get-started %}

{% data variables.product.prodname_dotcom %} provides a starter workflow for Ant that should work for most Java with Ant projects. The subsequent sections of this guide give examples of how you can customize this starter workflow.

{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.actions-tab %}
{% data reusables.actions.new-starter-workflow %}
1. The "{% ifversion actions-starter-template-ui %}Choose a workflow{% else %}Choose a workflow template{% endif %}" page shows a selection of recommended starter workflows. Search for "Java with Ant".
1. On the "Java with Ant" workflow, click {% ifversion actions-starter-template-ui %}**Configure**{% else %}**Set up this workflow**{% endif %}.

{%- ifversion ghes or ghae %}

If you don't find the "Java with Ant" starter workflow, copy the following workflow code to a new file called `ant.yml` in the `.github/workflows` directory of your repository.

```yaml copy
name: Java CI

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Set up JDK 11
uses: {% data reusables.actions.action-setup-java %}
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Ant
run: ant -noinput -buildfile build.xml
```
{%- endif %}

1. Edit the workflow as required. For example, change the Java version.
1. Click **Commit changes**.

{% ifversion fpt or ghec %}
The `ant.yml` workflow file is added to the `.github/workflows` directory of your repository.
{% endif %}

{% data reusables.actions.java-jvm-architecture %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ topics:
- Java
- Gradle
shortTitle: Build & test Java & Gradle
layout: inline
---

{% data reusables.actions.enterprise-github-hosted-runners %}
Expand All @@ -40,54 +39,61 @@ We recommend that you have a basic understanding of Java and the Gradle framewor

{% data reusables.actions.enterprise-setup-prereq %}

## Using the Gradle starter workflow

{% data variables.product.prodname_dotcom %} provides a Gradle starter workflow that will work for most Gradle-based Java projects. For more information, see the [Gradle starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/gradle.yml). {% data reusables.actions.workflows.starter-workflows %}

To get started quickly, you can choose the preconfigured Gradle starter workflow when you create a new workflow. For more information, see the "[AUTOTITLE](/actions/quickstart)."

You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.

{% note %}

**Notes:**

- {% data reusables.actions.actions-not-certified-by-github %}
- {% data reusables.actions.actions-use-sha-pinning %}

{% endnote %}

```yaml annotate copy
# {% data reusables.actions.workflows.workflow-syntax-name %}
name: Java CI

#
on: [push]
#
jobs:
build:

{% data reusables.actions.example-github-runner-comment %}
runs-on: ubuntu-latest
#
steps:
{% data reusables.actions.workflows.workflow-checkout-step-explainer %}
- uses: {% data reusables.actions.action-checkout %}
{% data reusables.actions.workflows.setup-java-step-explainer %}
- name: Set up JDK 17
uses: {% data reusables.actions.action-setup-java %}
with:
java-version: '17'
distribution: 'temurin'
# The "Validate Gradle wrapper" step validates the checksums of Gradle Wrapper JAR files present in the source tree.
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
# The "Build with Gradle" step does a build using the `gradle/gradle-build-action` action provided by the Gradle organization on {% data variables.product.prodname_dotcom %}. The action takes care of invoking Gradle, collecting results, and caching state between jobs. For more information see [`gradle/gradle-build-action`](https://github.com/gradle/gradle-build-action).
- name: Build with Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: build
```
## Using a Gradle starter workflow

{% data reusables.actions.starter-workflow-get-started %}

{% data variables.product.prodname_dotcom %} provides a starter workflow for Gradle that should work for most Java with Gradle projects. The subsequent sections of this guide give examples of how you can customize this starter workflow.

{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.actions-tab %}
{% data reusables.actions.new-starter-workflow %}
1. The "{% ifversion actions-starter-template-ui %}Choose a workflow{% else %}Choose a workflow template{% endif %}" page shows a selection of recommended starter workflows. Search for "Java with Gradle".
1. On the "Java with Gradle" workflow, click {% ifversion actions-starter-template-ui %}**Configure**{% else %}**Set up this workflow**{% endif %}.

{%- ifversion ghes or ghae %}

If you don't find the "Java with Gradle" starter workflow, copy the following workflow code to a new file called `gradle.yml` in the `.github/workflows` directory of your repository.

```yaml copy
name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Set up JDK 11
uses: {% data reusables.actions.action-setup-java %}
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
```
{%- endif %}

1. Edit the workflow as required. For example, change the Java version.

{% indented_data_reference reusables.actions.third-party-actions spaces=3 %}

1. Click **Commit changes**.

{% ifversion fpt or ghec %}
The `gradle.yml` workflow file is added to the `.github/workflows` directory of your repository.
{% endif %}

{% data reusables.actions.java-jvm-architecture %}

Expand Down
Loading