How To Use This Template
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.ymlGitHub Action accordingly. If you have multiple targets in your Swift Package, you need to pass the name of the Swift Package followed by an
-Packageas the scheme to the GitHub Action, e.g.,
StanfordProject-Packageif your Swift Package is named
- If your Swift Package does not provide any user interface or does not require an iOS application environment to function, you can remove the
UITestsapplication from the
Testsfolder. You need to update the
build-and-test.ymlGitHub 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
.xresultinput 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
- 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.ymlfile 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.