A Template Repository for a Swift Package-based Stanford Byers Center for Biodesign Digital Health Project

What's New



What's Changed

Full Changelog: 0.1.0...0.1.1


Build and Test codecov DOI

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:

  1. 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 named StanfordProject.
  2. 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 the Tests folder. You need to update the build-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.
  3. 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).
  4. 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.
  5. 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.
  6. 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.
  7. 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.

Stanford Byers Center for Biodesign Logo Stanford Byers Center for Biodesign Logo


  • Swift Tools 5.8.0
View More Packages from this Author


  • None
Last updated: Sat Nov 25 2023 06:01:57 GMT-1000 (Hawaii-Aleutian Standard Time)