Skip to content

Commit 66ae098

Browse files
committed
Adopt swiftlang's CI test suite
1 parent bfda7f0 commit 66ae098

File tree

4 files changed

+74
-91
lines changed

4 files changed

+74
-91
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Swift 6 Module Template
22

3+
Recipe: [![TestModule CI](https://github.com/fulldecent/swift6-module-template/actions/workflows/ci.yml/badge.svg)](https://github.com/fulldecent/swift6-module-template/actions/workflows/ci.yml)
4+
5+
Generated project: [![Swiftlang workflows](https://github.com/fulldecent/swift6-module-template/actions/workflows/swiftlang-workflows.yml/badge.svg?branch=production-test)](https://github.com/fulldecent/swift6-module-template/actions/workflows/swiftlang-workflows.yml)
6+
37
Use this template as a starting point for any Swift 6 module that you want other people to include in their projects.
48

59
:white_check_mark: STATUS: This template is ready and works in production code. See [releases](https://github.com/fulldecent/swift6-module-template/releases) to confirm we support the latest Xcode version.
@@ -14,7 +18,7 @@ Your new Swift module will immediately have working, compilable code, and implem
1418
- Clean folder structure
1519
- MIT license
1620
- Testing as a standard
17-
- Turnkey access to GitHub Actions testing
21+
- Turnkey access to GitHub Actions testing recommended by the Swift project
1822
- Semantic versioning and a CHANGELOG
1923
- Included example/demo app using SwiftUI
2024
- Use a Xcode project to manage your code
@@ -55,6 +59,33 @@ graph LR
5559
end
5660
```
5761

62+
## Deployment test
63+
64+
After updating the recipe and template xxPROJECTxNAMExx, also validate the GitHub Actions template for the inside project.
65+
66+
:information_source: This process is a workaround for a GitHub Actions system restriction that prevents one GitHub Action (the one for this template repository) from editing and kicking off another GitHub Action (the one inside the new xxPROJECTxNAMExx to test.
67+
68+
```sh
69+
git clone [email protected]:fulldecent/swift6-module-template.git ~/Desktop/swift6-module-template
70+
cd ~/Desktop/swift6-module-template
71+
export SMT_XXPROJECTXNAMEXX="TestModule"
72+
export SMT_ORGANIZATION_NAME="Test Organization"
73+
export SMT_COM_AN_ORGANIZATION_IDENTIFIER="com.test.organization"
74+
export SMT_AUTHOR_NAME="Test Author"
75+
export SMT_TODAYS_DATE="January 1, 2024"
76+
export SMT_TODAYS_YEAR="2024"
77+
export SMT_GITHUB_USERNAME="testuser"
78+
./configure.swift
79+
# ℹ️ Now OUTPUT/TestModule is is a complete project you could publish
80+
cp -r OUTPUT/TestModule ~/Desktop/swift6-module-template-production-test
81+
cd ~/Desktop/swift6-module-template-production-test
82+
git init
83+
git remote add origin [email protected]:fulldecent/swift6-module-template.git
84+
git add .
85+
git commit -m "Initial commit for production-test branch with TestModule contents"
86+
git push --force origin HEAD:production-test
87+
```
88+
5889
## Contributing
5990

6091
See the file [Recipe.md](Recipe.md) for the complete steps (e.g. Open Xcode, make new project, click here, type that, …) of how we made the template.

xxPROJECTxNAMExx/.github/workflows/ci.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Swiftlang workflows
2+
3+
# Adapted from https://github.com/apple/swift-collections/blob/bdfaffbba691f037100b115d9aa801f05e3d7fe8/.github/workflows/pull_request.yml
4+
5+
on:
6+
push:
7+
pull_request:
8+
9+
jobs:
10+
tests:
11+
name: Test
12+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
13+
with:
14+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "6.0"}, {"swift_version": "6.1"}]'
15+
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]'
16+
macos_exclude_xcode_versions: '[{"xcode_version": "26.0"}]'
17+
enable_macos_checks: true
18+
enable_wasm_sdk_build: true
19+
20+
embedded-swift:
21+
name: Build with Embedded Swift
22+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
23+
with:
24+
enable_linux_checks: false
25+
enable_macos_checks: false
26+
enable_windows_checks: false
27+
enable_wasm_sdk_build: false
28+
enable_embedded_wasm_sdk_build: true
29+
swift_flags: --target "xxPROJECTxNAMExx"
30+
31+
soundness:
32+
name: Soundness
33+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
34+
with:
35+
license_header_check_project_name: "xxPROJECTxNAMExx"

xxPROJECTxNAMExx/README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Thank you for using Swift 5 Module Template. Before you release your awesome pro
44

55
THIS LIST IS EASY, CHECK IT OFF ONE-BY-ONE BABY! ✔️ ✔️ ✔️
66

7-
- [ ] Open the project in Xcode and add features to xxPROJECTxNAMExx
8-
- [ ] Make sure you are using Swift 5 (Edit > Convert > To Current Swift Syntax…)
9-
- [ ] Fix all build errors and warnings, add tests (yes really)
10-
- [ ] Add a screenshot or AT LEAST some picture below in this README
11-
- [ ] Delete all this crap up here
12-
- [ ] Make one release (full steps are in [CONTRIBUTING.md] in case you forget)
7+
- [ ] Open the project in Xcode and add features to xxPROJECTxNAMExx
8+
- [ ] Make sure you are using Swift 5 (Edit > Convert > To Current Swift Syntax…)
9+
- [ ] Fix all build errors and warnings, add tests (yes really)
10+
- [ ] Add a screenshot or AT LEAST some picture below in this README
11+
- [ ] Delete all this crap up here
12+
- [ ] Make one release (full steps are in [CONTRIBUTING.md] in case you forget)
1313

14-
THEN YOU'RE DONE, GO STAR [swift5-module-template](https://github.com/fulldecent/swift5-module-template) FOR UPDATES.
14+
THEN YOU'RE DONE, GO STAR [swift6-module-template](https://github.com/fulldecent/swift6-module-template) FOR UPDATES.
1515

1616
----
1717

@@ -21,15 +21,12 @@ THEN YOU'RE DONE, GO STAR [swift5-module-template](https://github.com/fulldecent
2121

2222
<a href="https://placehold.it/400?text=Screen+shot"><img width=200 height=200 src="https://placehold.it/400?text=Screen+shot" alt="Screenshot" /></a>
2323

24-
2524
## Example
2625

2726
To run the example project, clone this repo, and open Example.xcworkspace from the iOS Example directory.
2827

29-
3028
## Requirements
3129

32-
3330
## Installation
3431

3532
Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done.
@@ -38,7 +35,6 @@ Add this to your project using Swift Package Manager. In Xcode that is simply: F
3835

3936
__AUTHOR NAME__
4037

41-
4238
## License
4339

4440
xxPROJECTxNAMExx is available under the MIT license. See [the LICENSE file](LICENSE) for more information.

0 commit comments

Comments
 (0)