Skip to content

Commit fa04e06

Browse files
authored
Merge pull request #5 from swiftlang/shahmishal/doc-update
Update README.md to include details about the Swift package repo
2 parents cea5b85 + e6c50d9 commit fa04e06

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,34 @@
33
This repository will contain reusable workflows to minimize redundant workflows across the organization. This effort will also facilitate the standardization of testing processes while empowering repository code owners to customize their testing plans as needed. The repository will contain workflows to support different types of repositories, such as Swift Package and Swift Compiler.
44

55
For more details on reusable workflows, please refer to the [Reusing workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows) section in the GitHub Docs.
6+
7+
## Reusable workflow for Swift package repositories
8+
9+
To enable pull request testing for all supported Swift versions (5.8, 5.9, 5.10, 6.0, and nightly) on Linux, add the following code example in `.github/workflows/pull_request.yml`:
10+
11+
```yaml
12+
name: pull_request
13+
14+
on:
15+
pull_request:
16+
types: [opened, reopened, synchronize]
17+
18+
jobs:
19+
tests:
20+
name: tests
21+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
22+
```
23+
24+
If your package only supports newer compiler versions, you can exclude older versions by using the `exclude_swift_versions` workflow input:
25+
26+
```yaml
27+
exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
28+
```
29+
30+
Additionally, if your package requires additional installed packages, you can use the `pre_build_command`:
31+
32+
```yaml
33+
pre_build_command: "apt-get update -y -q && apt-get install -y -q example"
34+
```
35+
36+
macOS and Windows platform support will be available soon.

0 commit comments

Comments
 (0)