Skip to content

Commit 3293ed0

Browse files
committed
Merge branch 'main' of github.com:github/docs-internal into sublanding-fixes
2 parents 7cf8dac + 0ec2fed commit 3293ed0

93 files changed

Lines changed: 6304 additions & 35616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/confirm-internal-staff-work-in-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
owner: 'github',
6262
repo: 'docs-internal',
6363
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
64-
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`
64+
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`,
65+
labels: ['OS confirmation'],
6566
});
6667
6768
core.setOutput('did_warn', 'true')

.github/workflows/ping-staging-apps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Ping staging apps
66

77
on:
88
schedule:
9-
- cron: '*/20 * * * *' # every twenty minutes
9+
- cron: '10,30,50 * * * *' # every twenty minutes
1010

1111
jobs:
1212
ping_staging_apps:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Remove stale staging apps
2+
3+
# **What it does**:
4+
# This cleans up any rogue staging applications that outlasted the closure of
5+
# their corresponding pull requests.
6+
# **Why we have it**:
7+
# Staging applications sometimes fail to be destroyed when their corresponding
8+
# pull request is closed or merged.
9+
# **Who does it impact**:
10+
# Anyone with a closed, spammy, or deleted pull request in docs or docs-internal.
11+
12+
on:
13+
schedule:
14+
- cron: '15,45 * * * *' # every thirty minutes at :15 and :45
15+
16+
jobs:
17+
remove_stale_staging_apps:
18+
name: Remove stale staging apps
19+
if: ${{ github.repository == 'github/docs-internal' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
23+
- name: npm ci
24+
run: npm ci
25+
- name: Run script
26+
run: script/remove-stale-staging-apps.js
27+
env:
28+
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}

.github/workflows/repo-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: Repo Sync
1818
on:
1919
workflow_dispatch:
2020
schedule:
21-
- cron: '*/15 * * * *' # every 15 minutes
21+
- cron: '10,25,40,55 * * * *' # every 15 minutes
2222

2323
jobs:
2424
close-invalid-repo-sync:

.github/workflows/send-issues-to-how-how-we-work-boards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
continue-on-error: true
1818
steps:
19-
- 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')
19+
- 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')
2020
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
2121
with:
2222
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
@@ -31,7 +31,7 @@ jobs:
3131
} catch (error) {
3232
console.log(error);
3333
}
34-
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && contains(github.event.issue.labels.*.name, 'feature')
34+
- if: (github.repository == 'github/docs-internal') && contains(github.event.issue.labels.*.name, 'engineering') && contains(github.event.issue.labels.*.name, 'batch')
3535
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
3636
with:
3737
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}

.github/workflows/send-prs-to-how-how-we-work-boards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
continue-on-error: true
1818
steps:
19-
- if: (github.repository == 'github/docs-internal') && contains(github.event.pull_request.labels.*.name, 'feature')
19+
- if: (github.repository == 'github/docs-internal') && contains(github.event.pull_request.labels.*.name, 'batch')
2020
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
2121
with:
2222
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}

.github/workflows/test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
test-group: [content, graphql, meta, rendering, routing, unit]
26+
test-group: [content, graphql, meta, rendering, routing, unit, linting]
2727
steps:
2828
- name: Check out repo
2929
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
test-group: [content, graphql, meta, rendering, routing, unit]
28+
# The same array lives in test-windows.yml, so make any updates there too.
29+
test-group: [content, graphql, meta, rendering, routing, unit, linting]
2930
steps:
3031
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
3132
# Even if if doesn't do anything
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: Building and testing Swift
3+
intro: You can create a continuous integration (CI) workflow to build and test your Swift project.
4+
product: '{% data reusables.gated-features.actions %}'
5+
versions:
6+
free-pro-team: '*'
7+
enterprise-server: '>=2.22'
8+
github-ae: '*'
9+
type: 'tutorial'
10+
topics:
11+
- 'CI'
12+
- 'Swift'
13+
---
14+
15+
{% data reusables.actions.enterprise-beta %}
16+
{% data reusables.actions.enterprise-github-hosted-runners %}
17+
{% data reusables.actions.ae-beta %}
18+
19+
### Introduction
20+
21+
This guide shows you how to build and test a Swift package.
22+
23+
{% 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)."
24+
{% 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 %}
25+
26+
### Prerequisites
27+
28+
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)."
29+
30+
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.
31+
32+
### Starting with the Swift workflow template
33+
34+
{% 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).
35+
36+
To get started quickly, add the template to the `.github/workflows` directory of your repository.
37+
38+
{% raw %}
39+
```yaml{:copy}
40+
name: Swift
41+
42+
on: [push]
43+
44+
jobs:
45+
build:
46+
47+
runs-on: macos-latest
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Build
52+
run: swift build
53+
- name: Run tests
54+
run: swift test
55+
```
56+
{% endraw %}
57+
58+
### Specifying a Swift version
59+
60+
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.
61+
62+
If you are using a self-hosted runner, you must install your desired Swift versions and add them to `PATH`.
63+
64+
The examples below demonstrate using the `fwal/setup-swift` action.
65+
66+
#### Using multiple Swift versions
67+
68+
You can configure your job to use a multiple versions of Swift in a build matrix.
69+
70+
{% raw %}
71+
```yaml{:copy}
72+
name: Swift
73+
74+
on: [push]
75+
76+
jobs:
77+
build:
78+
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
79+
strategy:
80+
matrix:
81+
os: [ubuntu-latest, macos-latest]
82+
swift: ["5.2", "5.3"]
83+
runs-on: ${{ matrix.os }}
84+
steps:
85+
- uses: fwal/setup-swift@v1
86+
with:
87+
swift-version: ${{ matrix.swift }}
88+
- uses: actions/checkout@v2
89+
- name: Build
90+
run: swift build
91+
- name: Run tests
92+
run: swift test
93+
```
94+
{% endraw %}
95+
96+
#### Using a single specific Swift version
97+
98+
You can configure your job to use a single specific version of Swift, such as `5.3.3`.
99+
100+
{% raw %}
101+
```yaml{:copy}
102+
steps:
103+
- uses: fwal/setup-swift@v1
104+
with:
105+
swift-version: "5.3.3"
106+
- name: Get swift version
107+
run: swift --version # Swift 5.3.3
108+
```
109+
{% endraw %}
110+
111+
### Building and testing your code
112+
113+
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:
114+
115+
{% raw %}
116+
```yaml{:copy}
117+
steps:
118+
- uses: actions/checkout@v2
119+
- uses: fwal/setup-swift@v1
120+
with:
121+
swift-version: "5.3.3"
122+
- name: Build
123+
run: swift build
124+
- name: Run tests
125+
run: swift test
126+
```
127+
{% endraw %}

content/actions/guides/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ includeGuides:
4242
- /actions/guides/building-and-testing-java-with-maven
4343
- /actions/guides/building-and-testing-java-with-gradle
4444
- /actions/guides/building-and-testing-java-with-ant
45-
- /actions/guides/building-and-testing-xamarin-applications
45+
- /actions/guide/building-and-testing-swift
4646
- /actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development
47+
- /actions/guides/building-and-testing-xamarin-applications
4748
- /actions/guides/publishing-nodejs-packages
4849
- /actions/guides/publishing-java-packages-with-maven
4950
- /actions/guides/publishing-java-packages-with-gradle
@@ -84,6 +85,7 @@ includeGuides:
8485
<!-- {% link_in_list /building-and-testing-java-with-maven %} -->
8586
<!-- {% link_in_list /building-and-testing-java-with-gradle %} -->
8687
<!-- {% link_in_list /building-and-testing-java-with-ant %} -->
88+
<!-- {% link_in_list /building-and-testing-swift %}-->
8789
<!-- {% link_in_list /installing-an-apple-certificate-on-macos-runners-for-xcode-development %} -->
8890
<!-- {% link_in_list /building-and-testing-xamarin-applications %} -->
8991
<!-- {% link_in_list /about-packaging-with-github-actions %} -->

0 commit comments

Comments
 (0)