-
Notifications
You must be signed in to change notification settings - Fork 61.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'docs/main' into code-fence-languages
- Loading branch information
Showing
498 changed files
with
542,200 additions
and
3,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint workflows | ||
|
||
on: | ||
workflow_dispatch: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# branches-ignore: | ||
# - translations | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
|
||
- name: Run linter | ||
uses: cschleiden/actions-linter@43fd4e08e52ed40c0e2782dc2425694388851576 | ||
with: | ||
workflows: '[".github/workflows/*.yml"]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+106 KB
assets/images/enterprise/management-console/actions-aws-s3-storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.2 KB
assets/images/enterprise/management-console/actions-azure-storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62 KB
assets/images/enterprise/management-console/actions-minio-force-path-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+104 KB
assets/images/enterprise/management-console/actions-minio-s3-storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+59.9 KB
(680%)
assets/images/enterprise/management-console/code-scanning-disable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60 KB
(700%)
assets/images/enterprise/management-console/enable-code-scanning-checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.79 KB
assets/images/enterprise/management-console/enable-secret-scanning-checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.1 KB
assets/images/enterprise/management-console/select-enable-github-mobile-apps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.6 KB
(270%)
assets/images/enterprise/management-console/sidebar-advanced-security.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10.1 KB
(210%)
assets/images/enterprise/site-admin-settings/add-announcement-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.4 KB
assets/images/enterprise/site-admin-settings/add-mandatory-message-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-36.8 KB
(35%)
assets/images/enterprise/site-admin-settings/edit-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.3 KB
assets/images/enterprise/site-admin-settings/mandatory-message-text-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.96 KB
assets/images/enterprise/site-admin-settings/message-preview-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.93 KB
assets/images/enterprise/site-admin-settings/message-save-changes-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+169 Bytes
(100%)
assets/images/enterprise/site-admin-settings/sign-out-add-message-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.9 KB
.../help/business-accounts/billing-license-info-click-view-details-or-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+82.9 KB
(260%)
assets/images/help/business-accounts/billing-license-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+43.1 KB
...s/images/help/organizations/security-and-analysis-disable-or-enable-all-ghe.png
Oops, something went wrong.
Binary file added
BIN
+21.4 KB
...p/organizations/security-and-analysis-disable-or-enable-secret-scanning-ghe.png
Oops, something went wrong.
Binary file added
BIN
+19.1 KB
...ations/security-and-analysis-enable-or-disable-secret-scanning-checkbox-ghe.png
Oops, something went wrong.
Binary file added
BIN
+15 KB
.../images/help/organizations/security-and-analysis-enable-secret-scanning-ghe.png
Oops, something went wrong.
Binary file added
BIN
+15.3 KB
...p/organizations/security-and-analysis-secret-scanning-enable-by-default-ghe.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+52.8 KB
assets/images/help/package-registry/s3-aws-storage-bucket-details.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+53.9 KB
(240%)
assets/images/help/repository/code-scanning-set-up-this-workflow.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+66.6 KB
assets/images/help/repository/enable-dependabot-security-updates-button.png
Oops, something went wrong.
Binary file removed
BIN
-47.6 KB
assets/images/help/repository/enable-dependabot-security-updates-drop-down.png
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+8.31 KB
(150%)
assets/images/help/repository/secret-scanning-click-alert.png
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+13.7 KB
(180%)
assets/images/help/repository/secret-scanning-resolve-alert.png
Oops, something went wrong.
Binary file added
BIN
+38.1 KB
assets/images/help/repository/security-and-analysis-disable-or-enable-ghe.png
Oops, something went wrong.
Binary file added
BIN
+32.6 KB
.../repository/security-and-analysis-security-alerts-person-or-team-search-ghe.png
Oops, something went wrong.
Binary file added
BIN
+37.4 KB
...images/help/repository/security-and-analysis-security-alerts-username-x-ghe.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
--- | ||
title: Building and testing .NET | ||
intro: You can create a continuous integration (CI) workflow to build and test your .NET project. | ||
product: '{% data reusables.gated-features.actions %}' | ||
versions: | ||
free-pro-team: '*' | ||
enterprise-server: '>=2.22' | ||
--- | ||
|
||
### Introduction | ||
|
||
This guide shows you how to build, test, and publish a .NET package. | ||
|
||
{% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with preinstalled software, which includes the .NET Core SDK. For a full list of up-to-date software and the preinstalled versions of .NET Core SDK, see [software installed on {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/specifications-for-github-hosted-runners). | ||
|
||
### Prerequisites | ||
|
||
You should already be familiar with YAML syntax and how it's used with {% data variables.product.prodname_actions %}. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions)." | ||
|
||
We recommend that you have a basic understanding of the .NET Core SDK. For more information, see [Getting started with .NET](https://dotnet.microsoft.com/learn). | ||
|
||
### Starting with the .NET workflow template | ||
|
||
{% data variables.product.prodname_dotcom %} provides a .NET workflow template that should work for most .NET projects, and this guide includes examples that show you how to customize this template. For more information, see the [.NET workflow template](https://github.com/actions/setup-dotnet). | ||
|
||
To get started quickly, add the template to the `.github/workflows` directory of your repository. | ||
|
||
{% raw %} | ||
```yaml | ||
name: dotnet package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dotnet-version: [ '2.2.103', '3.0', '3.1.x' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core SDK ${{ matrix.dotnet }} | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: {{ matrix.dotnet-version }} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
- name: Test | ||
run: dotnet test --no-restore --verbosity normal | ||
``` | ||
{% endraw %} | ||
### Specifying a .NET version | ||
To use a preinstalled version of the .NET Core SDK on a {% data variables.product.prodname_dotcom %}-hosted runner, use the `setup-dotnet` action. This action finds a specific version of .NET from the tools cache on each runner, and adds the necessary binaries to `PATH`. These changes will persist for the remainder of the job. | ||
|
||
The `setup-dotnet` action is the recommended way of using .NET with {% data variables.product.prodname_actions %}, because it ensures consistent behavior across different runners and different versions of .NET. If you are using a self-hosted runner, you must install .NET and add it to `PATH`. For more information, see the [`setup-dotnet`](https://github.com/marketplace/actions/setup-dotnet). | ||
|
||
#### Using multiple .NET versions | ||
|
||
{% raw %} | ||
```yaml | ||
name: dotnet package | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dotnet: [ '2.2.103', '3.0', '3.1.x' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet ${{ matrix.dotnet-version }} | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
# You can test your matrix by printing the current dotnet version | ||
- name: Display dotnet version | ||
run: dotnet --version | ||
``` | ||
{% endraw %} | ||
|
||
#### Using a specific .NET version | ||
|
||
You can configure your job to use a specific version of .NET, such as `3.1.3`. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest minor release of .NET 3. | ||
|
||
{% raw %} | ||
```yaml | ||
- name: Setup .NET 3.x | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
# Semantic version range syntax or exact version of a dotnet version | ||
dotnet-version: '3.x' | ||
``` | ||
{% endraw %} | ||
|
||
### Installing dependencies | ||
|
||
{% data variables.product.prodname_dotcom %}-hosted runners have the NuGet package manager installed. You can use the dotnet CLI to install dependencies from the NuGet package registry before building and testing your code. For example, the YAML below installs the `Newtonsoft` package. | ||
|
||
{% raw %} | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: '3.1.x' | ||
- name: Install dependencies | ||
run: dotnet add package Newtonsoft.Json --version 12.0.1 | ||
``` | ||
{% endraw %} | ||
|
||
{% if currentVersion == "free-pro-team@latest" %} | ||
|
||
#### Caching dependencies | ||
|
||
You can cache NuGet dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For example, the YAML below installs the `Newtonsoft` package. | ||
|
||
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)." | ||
|
||
{% raw %} | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: '3.1.x' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget | ||
- name: Install dependencies | ||
run: dotnet add package Newtonsoft.Json --version 12.0.1 | ||
``` | ||
{% endraw %} | ||
|
||
{% note %} | ||
|
||
**Note:** Depending on the number of dependencies, it may be faster to use the dependency cache. Projects with many large dependencies should see a performance increase as it cuts down the time required for downloading. Projects with fewer dependencies may not see a significant performance increase and may even see a slight decrease due to how NuGet installs cached dependencies. The performance varies from project to project. | ||
|
||
{% endnote %} | ||
|
||
{% endif %} | ||
|
||
### Building and testing your code | ||
|
||
You can use the same commands that you use locally to build and test your code. This example demonstrates how to use `dotnet build` and `dotnet test` in a job: | ||
|
||
{% raw %} | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: '3.1.x' | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build | ||
- name: Test with the dotnet CLI | ||
run: dotnet test | ||
``` | ||
{% endraw %} | ||
|
||
### Packaging workflow data as artifacts | ||
|
||
After a workflow completes, you can upload the resulting artifacts for analysis. For example, you may need to save log files, core dumps, test results, or screenshots. The following example demonstrates how you can use the `upload-artifact` action to upload test results. | ||
|
||
For more information, see "[Persisting workflow data using artifacts](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)." | ||
|
||
{% raw %} | ||
```yaml | ||
name: dotnet package | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dotnet-version: [ '2.2.103', '3.0', '3.1.x' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1.6.0 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Test with dotnet | ||
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" | ||
- name: Upload dotnet test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dotnet-results-${{ matrix.dotnet-version }} | ||
path: TestResults-${{ matrix.dotnet-version }} | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
``` | ||
{% endraw %} | ||
|
||
### Publishing to package registries | ||
|
||
You can configure your workflow to publish your Dotnet package to a package registry when your CI tests pass. You can use repository secrets to store any tokens or credentials needed to publish your binary. The following example creates and publishes a package to {% data variables.product.prodname_registry %} using `dotnet core cli`. | ||
|
||
{% raw %} | ||
```yaml | ||
name: Upload dotnet package | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' # SDK Version to use. | ||
source-url: https://nuget.pkg.github.com/<owner>/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- run: dotnet build <my project> | ||
- name: Create the package | ||
run: dotnet pack --configuration Release <my project> | ||
- name: Publish the package to GPR | ||
run: dotnet nuget push <my project>/bin/Release/*.nupkg | ||
``` | ||
{% endraw %} |
Oops, something went wrong.