forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into github#268-active-language-display
- Loading branch information
Showing
159 changed files
with
7,453 additions
and
7,410 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
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 |
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,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 }} |
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
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.
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,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 %} |
Oops, something went wrong.