The template repository contains a template Swift Package, including a continuous integration setup.
Follow these steps to customize it to your needs:
- Rename the Swift Package. Be sure that you update the name in the
build-and-test.yml
GitHub Action accordingly. If you have multiple targets in your Swift Package, you need to pass the name of the Swift Package followed by an-Package
as the scheme to the GitHub Action, e.g.,StanfordProject-Package
if your Swift Package is namedStanfordProject
. - If your Swift Package does not provide any user interface or does not require an iOS application environment to function, you can remove the
UITests
application from theTests
folder. You need to update thebuild-and-test.yml
GitHub Action accordingly by removing the GitHub Action that builds and tests the application, removing the dependency from the code coverage upload step, and removing the UI test.xresult
input from the code coverage test. - If your Swift Package uses UI test, you need to ...
- ... add it to the scheme editor (Scheme > Edit Scheme) and your targets to the "Build" configuration and ensure that it is built before the test app target when building for the "Test" configuration. It is not required to enable building for other configurations like "Analyze", "Run", "Profile", or "Archive".
- ... add it as a linked framework in the main target configuration (In your Xcode project settings, select your test app target > General > Frameworks, Libraries, and Embedded Comments).
- ... add ensure that the targets are all added in the code coverage settings of your .xctestplan file in the Xcode Project (Shared Settings > Code Coverage > Code Coverage).
- You will either need to add the CodeCov GitHub App or add a codecov.io token to your GitHub Actions Secrets following the instructions of the Codecov GitHub Action. The StanfordBDHG organization already has the CodeCov GitHub App installed. If you do not want to cover test coverage data, you can remove the code coverage job in the
build-and-test.yml
GitHub Action. - Adjust this README.md to describe your project and adjust the badges at the top to point to the correct GitHub Action of your repository and Codecov badge.
- The Swift Package template includes a Swift Package Index configuration file to automatically build the package and host the documentation on the Swift Package Index website. Adjust the
.spi.yml
file to include all targets that you want to build documentation for. You can follow the instructions of the Swift Package Index to include your Swift Package in the Swift Package Index. You can link to the API documentation from your README file. - Adjust the CITATION.cff file to amend information about the new Swift Package (learn more about CITATION files on GitHub) and register the Swift Package on Zenodo.
The project can be added to your Xcode project or Swift Package using the Swift Package Manager.
Xcode: For an Xcode project, follow the instructions on adding package dependencies to your app.
Swift Package: You can follow the Swift Package Manager documentation about defining dependencies to add this project as a dependency to your Swift Package.
This project is licensed under the MIT License. See Licenses for more information.
This project is developed as part of the Stanford Byers Center for Biodesign at Stanford University. See CONTRIBUTORS.md for a full list of all TemplatePackage contributors.