Skip to content

Commit

Permalink
Merge branch 'main' into github#268-active-language-display
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenolithes authored Apr 30, 2021
2 parents adf530e + c043378 commit 8ca48a4
Show file tree
Hide file tree
Showing 159 changed files with 7,453 additions and 7,410 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/confirm-internal-staff-work-in-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
owner: 'github',
repo: 'docs-internal',
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
body: `@${context.payload.sender.login} opened https://github.com/github/docs/issues/${issueNo} publicly in the github/docs repo, instead of the private github/docs-internal repo.\n\n@${context.payload.sender.login}, please confirm that this belongs in the public repo and that no sensitive information was disclosed by commenting below and closing the issue.\n\nIf this was not intentional and sensitive information was shared, please delete https://github.com/github/docs/issues/${issueNo} and notify us in the \#docs-open-source channel.\n\nThanks! \n\n/cc @github/docs @github/docs-engineering`
body: `@${context.payload.sender.login} opened https://github.com/github/docs/issues/${issueNo} publicly in the github/docs repo, instead of the private github/docs-internal repo.\n\n@${context.payload.sender.login}, please confirm that this belongs in the public repo and that no sensitive information was disclosed by commenting below and closing the issue.\n\nIf this was not intentional and sensitive information was shared, please delete https://github.com/github/docs/issues/${issueNo} and notify us in the \#docs-open-source channel.\n\nThanks! \n\n/cc @github/docs @github/docs-engineering`,
labels: ['OS confirmation'],
});
core.setOutput('did_warn', 'true')
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Enterprise date updater

# **What it does**: Runs on a schedule to update lib/enterprise-dates.json.
# **Why we have it**: The lib/enterprise-dates.json file needs to be up-to-date
# for the .github/workflows/open-enterprise-issue.yml workflow and the
# tests/content/algolia-search.js test.
# **Who does it impact**: Docs engineering, docs content.

on:
workflow_dispatch:
schedule:
- cron: '39 2 * * 2' # At 02:39 on Tuesday

# **IMPORTANT:** Do not change the FREEZE environment variable set here!
# This workflow runs on a recurring basis. To temporarily disable it (e.g.,
# during a docs deployment freeze), add an Actions Secret to the repo settings
# called `FREEZE` with a value of `true`. To re-enable updates, simply
# delete that Secret from the repo settings. The environment variable here
# will duplicate that Secret's value for later evaluation.
env:
FREEZE: ${{ secrets.FREEZE }}

jobs:
open_enterprise_issue:
name: Enterprise date updater
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- if: ${{ env.FREEZE == 'true' }}
run: |
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Run script/update-enterprise-dates.js
run: |
script/update-enterprise-dates.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
with:
# need to use a token with repo and workflow scopes for this step
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '🤖 ran script/update-enterprise-dates.js'
title: 🤖 lib/enterprise-dates.json update
body:
"Hello! The GitHub Enterprise Server release dates have changed.\n\n
If CI passes, this PR will be auto-merged. :green_heart:\n\n
If CI does not pass or other problems arise, contact #docs-engineering on slack.\n\nThis PR was 🤖-crafted by `.github/workflows/enterprise-dates.yml`. 🧶"
labels: automerge,autoupdate
branch: enterprise-server-dates-update
delete-branch: true
- if: ${{ failure() }}
name: Delete remote branch (if previous steps failed)
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: enterprise-server-dates-update
- if: ${{ steps.create-pull-request.outputs.pull-request-number }}
name: Approve
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
with:
github-token: ${{ secrets.DOCUBOT_REPO_PAT }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }}
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last enterprise-dates run for ${{github.repository}} failed. See https://github.com/github/${{github.repository}}/actions/workflows/enterprise-dates.yml
2 changes: 1 addition & 1 deletion .github/workflows/ping-staging-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Ping staging apps

on:
schedule:
- cron: '*/20 * * * *' # every twenty minutes
- cron: '10,30,50 * * * *' # every twenty minutes

jobs:
ping_staging_apps:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/remove-stale-staging-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Remove stale staging apps

# **What it does**:
# This cleans up any rogue staging applications that outlasted the closure of
# their corresponding pull requests.
# **Why we have it**:
# Staging applications sometimes fail to be destroyed when their corresponding
# pull request is closed or merged.
# **Who does it impact**:
# Anyone with a closed, spammy, or deleted pull request in docs or docs-internal.

on:
schedule:
- cron: '15,45 * * * *' # every thirty minutes at :15 and :45

jobs:
remove_stale_staging_apps:
name: Remove stale staging apps
if: ${{ github.repository == 'github/docs-internal' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci
run: npm ci
- name: Run script
run: script/remove-stale-staging-apps.js
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
2 changes: 1 addition & 1 deletion .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: Repo Sync
on:
workflow_dispatch:
schedule:
- cron: '*/15 * * * *' # every 15 minutes
- cron: '10,25,40,55 * * * *' # every 15 minutes

jobs:
close-invalid-repo-sync:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/send-issues-to-how-how-we-work-boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && !contains(github.event.issue.labels.*.name, 'feature') && !contains(github.event.issue.labels.*.name, 'epic')
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && !contains(github.event.issue.labels.*.name, 'batch') && !contains(github.event.issue.labels.*.name, 'epic')
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
Expand All @@ -31,7 +31,7 @@ jobs:
} catch (error) {
console.log(error);
}
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && contains(github.event.issue.labels.*.name, 'feature')
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && contains(github.event.issue.labels.*.name, 'batch')
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/send-prs-to-how-how-we-work-boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- if: (github.repository == 'github/docs-internal') && contains(github.event.pull_request.labels.*.name, 'feature')
- if: (github.repository == 'github/docs-internal') && contains(github.event.pull_request.labels.*.name, 'batch')
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-group: [content, graphql, meta, rendering, routing, unit]
test-group: [content, graphql, meta, rendering, routing, unit, linting]
steps:
- name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
strategy:
fail-fast: false
matrix:
test-group: [content, graphql, meta, rendering, routing, unit]
# The same array lives in test-windows.yml, so make any updates there too.
test-group: [content, graphql, meta, rendering, routing, unit, linting]
steps:
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
# Even if if doesn't do anything
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ defaultPlatform: linux
- type: `String`. This should reference learning tracks' names defined in [`data/learning-tracks/*.yml`](../data/learning-tracks/README.md).
- Optional

**Note: the first learning track is by-default the featured track.*
**Note: the featured track is set by a specific property in the learning tracks YAML. See that [README](../data/learning-tracks/README.md) for details.*

### `includeGuides`
- Purpose: Render a list of articles, filterable by `type` and `topics`. Only applicable when used with `layout: product-sublanding`.
Expand Down
12 changes: 6 additions & 6 deletions content/actions/guides/building-and-testing-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
# You can test your matrix by printing the current dotnet version
Expand All @@ -102,7 +102,7 @@ You can configure your job to use a specific version of .NET, such as `3.1.3`. A
{% raw %}
```yaml
- name: Setup .NET 3.x
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v1
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '3.x'
Expand All @@ -118,7 +118,7 @@ You can configure your job to use a specific version of .NET, such as `3.1.3`. A
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Install dependencies
Expand All @@ -139,7 +139,7 @@ For more information, see "[Caching dependencies to speed up workflows](/actions
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: actions/cache@v2
Expand Down Expand Up @@ -171,7 +171,7 @@ You can use the same commands that you use locally to build and test your code.
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Install dependencies
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
Expand Down
127 changes: 127 additions & 0 deletions content/actions/guides/building-and-testing-swift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
title: Building and testing Swift
intro: You can create a continuous integration (CI) workflow to build and test your Swift project.
product: '{% data reusables.gated-features.actions %}'
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
github-ae: '*'
type: 'tutorial'
topics:
- 'CI'
- 'Swift'
---

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

### Introduction

This guide shows you how to build and test a Swift package.

{% if currentVersion == "github-ae@latest" %} To build and test your Swift project on {% data variables.product.prodname_ghe_managed %}, you will need to create a custom operating system image that includes the necessary Swift dependencies. For instructions on how to make sure your {% data variables.actions.hosted_runner %} has the required software installed, see "[Creating custom images](/actions/using-github-hosted-runners/creating-custom-images)."
{% else %}{% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with preinstalled software, and the Ubuntu and macOS runners include the dependencies for building Swift packages. For a full list of up-to-date software and the preinstalled versions of Swift and Xcode, see "[About GitHub-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software)."{% endif %}

### 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 Swift packages. For more information, see "[Swift Packages](https://developer.apple.com/documentation/swift_packages)" in the Apple developer documentation.

### Starting with the Swift workflow template

{% data variables.product.prodname_dotcom %} provides a Swift workflow template that should work for most Swift projects, and this guide includes examples that show you how to customize this template. For more information, see the [Swift workflow template](https://github.com/actions/starter-workflows/blob/main/ci/swift.yml).

To get started quickly, add the template to the `.github/workflows` directory of your repository.

{% raw %}
```yaml{:copy}
name: Swift
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build
- name: Run tests
run: swift test
```
{% endraw %}

### Specifying a Swift version

To use a specific preinstalled version of Swift on a {% data variables.product.prodname_dotcom %}-hosted runner, use the `fwal/setup-swift` action. This action finds a specific version of Swift from the tools cache on the runner and adds the necessary binaries to `PATH`. These changes will persist for the remainder of a job. For more information, see the [`fwal/setup-swift`](https://github.com/marketplace/actions/setup-swift) action.

If you are using a self-hosted runner, you must install your desired Swift versions and add them to `PATH`.

The examples below demonstrate using the `fwal/setup-swift` action.

#### Using multiple Swift versions

You can configure your job to use a multiple versions of Swift in a build matrix.

{% raw %}
```yaml{:copy}
name: Swift
on: [push]
jobs:
build:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["5.2", "5.3"]
runs-on: ${{ matrix.os }}
steps:
- uses: fwal/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v2
- name: Build
run: swift build
- name: Run tests
run: swift test
```
{% endraw %}

#### Using a single specific Swift version

You can configure your job to use a single specific version of Swift, such as `5.3.3`.

{% raw %}
```yaml{:copy}
steps:
- uses: fwal/setup-swift@v1
with:
swift-version: "5.3.3"
- name: Get swift version
run: swift --version # Swift 5.3.3
```
{% endraw %}

### Building and testing your code

You can use the same commands that you use locally to build and test your code using Swift. This example demonstrates how to use `swift build` and `swift test` in a job:

{% raw %}
```yaml{:copy}
steps:
- uses: actions/checkout@v2
- uses: fwal/setup-swift@v1
with:
swift-version: "5.3.3"
- name: Build
run: swift build
- name: Run tests
run: swift test
```
{% endraw %}
Loading

0 comments on commit 8ca48a4

Please sign in to comment.