diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..5ee7f48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,55 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: 🐛 Bug report +description: File a bug report +title: "🐛 Bug report: Remove this title with a descriptive title." +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: description + attributes: + label: Description + description: Please provide a description of the bug you encountered. + placeholder: A clear and concise description of the bug. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction + description: Please provide a description of how to reproduce the bug. + placeholder: A description of how to reproduce the bug. + validations: + required: true + - type: textarea + id: expectedbehavior + attributes: + label: Expected behavior + description: Please provide a clear and concise description of what you expected to happen. + placeholder: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + id: additionalcontext + attributes: + label: Additional context + description: Please provide any additional context that might be relevant for your bug report. + placeholder: Any additional context that might be relevant for your bug report. + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct and Contributing Guidelines + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..802b9b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,13 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +blank_issues_enabled: false +contact_links: + - name: Discussions & Support + url: https://github.com/orgs/StanfordBDHG/discussions + about: We use GitHub Discussions for any discussions and support diff --git a/.github/ISSUE_TEMPLATE/internal_change.yml b/.github/ISSUE_TEMPLATE/internal_change.yml new file mode 100644 index 0000000..d6b37da --- /dev/null +++ b/.github/ISSUE_TEMPLATE/internal_change.yml @@ -0,0 +1,47 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: 💾 Internal change +description: Suggest an internal improvement for this project +title: "💾 Internal change: Remove this title with a descriptive title." +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to suggest an internal improvement for this project! + - type: textarea + id: problem + attributes: + label: Problem + description: Please provide a description of the problem the improvement will address. + placeholder: A description of the problem the improvement will address. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Solution + description: Please provide a clear and concise description of the improvement and how it should work. + placeholder: A clear and concise description of the improvement and how it should work. + validations: + required: true + - type: textarea + id: additionalcontext + attributes: + label: Additional context + description: Please provide any additional context that might be relevant for your improvement. + placeholder: Any additional context that might be relevant for your improvement. + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct and Contributing Guidelines + required: true diff --git a/.github/ISSUE_TEMPLATE/major_feature.yml b/.github/ISSUE_TEMPLATE/major_feature.yml new file mode 100644 index 0000000..7d82388 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/major_feature.yml @@ -0,0 +1,63 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: 🚀 Major feature request +description: Suggest a new idea for this project +title: "🚀 Major feature request: Remove this title with a descriptive title." +labels: ["enhancement", "major version bump"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to share the major feature request! + - type: textarea + id: usecase + attributes: + label: Use Case + description: Please provide a description of the use case or context in which the feature will be used. + placeholder: A clear and concise description of the use case or context in which the feature will be used. + validations: + required: true + - type: textarea + id: problem + attributes: + label: Problem + description: Please provide a description of the problem the feature will address. + placeholder: A description of the problem the feature will address. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Solution + description: Please provide a clear and concise description of the feature and how it should work. + placeholder: A clear and concise description of the feature and how it should work. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: Please provide a clear and concise description of any alternative solutions or features you've considered. Is there already software that has the behavior you're interested in? What is it, and how does it work? + placeholder: A clear and concise description of any alternative solutions or features you've considered. Is there already software that has the behavior you're interested in? What is it, and how does it work? + validations: + required: true + - type: textarea + id: additionalcontext + attributes: + label: Additional context + description: Please provide any additional context that might be relevant for your feature report + placeholder: Any additional context that might be relevant for your feature report + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct and Contributing Guidelines + required: true diff --git a/.github/ISSUE_TEMPLATE/minor_feature.yml b/.github/ISSUE_TEMPLATE/minor_feature.yml new file mode 100644 index 0000000..4ab245f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/minor_feature.yml @@ -0,0 +1,47 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: 🏎 Minor feature request +description: Suggest an improvement for this project +title: "🏎 Minor feature request: Remove this title with a descriptive title." +labels: ["enhancement", "minor version bump"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to share the minor feature request! + - type: textarea + id: problem + attributes: + label: Problem + description: Please provide a description of the problem the feature will address. + placeholder: A description of the problem the feature will address. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Solution + description: Please provide a clear and concise description of the feature and how it should work. + placeholder: A clear and concise description of the feature and how it should work. + validations: + required: true + - type: textarea + id: additionalcontext + attributes: + label: Additional context + description: Please provide any additional context that might be relevant for your feature report. + placeholder: Any additional context that might be relevant for your feature report. + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct and Contributing Guidelines + required: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..2ea0868 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,40 @@ + + +# *Name of the PR* + +## :recycle: Current situation & Problem +*Describe the current situation (if possible, with an exemplary (or real) code snippet and/or where this is used)* +*Please link any open issue that is addressed with this PR* + +## :bulb: Proposed solution +*Describe the solution and how this affects the project and internal structure* + +## :gear: Release Notes +*Add a summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.* +*Include code snippets that provide examples of the feature implemented if it appends or changes the public interface.* + +## :heavy_plus_sign: Additional Information +*Provide some additional information if possible* + +### Related PRs +*Reference the related PRs* + +### Testing +*Are there tests included? If yes, which situations are tested, and which corner cases are missing?* + +### Reviewer Nudging +*Where should the reviewer start? Where is a good entry point?* + +### Code of Conduct & Contributing Guidelines + +By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): +- [ ] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md). + diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..d986a94 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,23 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +changelog: + exclude: + authors: + - PaulsAutomationBot + categories: + - title: Semantic Version Major + labels: + - major version bump + - title: Semantic Version Minor + labels: + - bug + - enhancement + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/build-and-test-spm.yml b/.github/workflows/build-and-test-spm.yml new file mode 100644 index 0000000..717829a --- /dev/null +++ b/.github/workflows/build-and-test-spm.yml @@ -0,0 +1,72 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Build and Test Swift Package Manager + +on: + workflow_call: + inputs: + path: + description: 'The path where the Swift Package is located. Defaults to $GITHUB_WORKSPACE' + required: false + type: string + default: '.' + packagename: + description: 'Name of the package required for generating a test coverage' + required: true + type: string + test: + description: 'A flag indicating if the Swift package contains tests' + required: false + type: boolean + default: true + +jobs: + macos: + name: macOS ${{ matrix.configuration }} + runs-on: macos-12 + strategy: + fail-fast: false + matrix: + configuration: [debug, release, release_testing] + defaults: + run: + working-directory: ${{ inputs.path }} + steps: + - uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Check Environment + run: | + xcodebuild -version + swift --version + echo "inputs.packagename: ${{ inputs.packagename }}" + echo "inputs.path: ${{ inputs.path }}" + echo "inputs.test: ${{ inputs.test }}" + echo "matrix.configuration: ${{ matrix.configuration }}" + echo "cache key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + - uses: actions/cache@v3 + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + - name: Release Build + if: matrix.configuration == 'release' + run: swift build -c release + - name: Release Build & Test + if: matrix.configuration == 'release_testing' && inputs.test + run: swift test -c release -Xswiftc -enable-testing -Xswiftc -DRELEASE_TESTING + - name: Debug Build & Test + if: matrix.configuration == 'debug' && inputs.test + run: swift test -c debug --enable-code-coverage -Xswiftc -DCOVERAGE + - name: Convert coverage report + if: matrix.configuration == 'debug' && inputs.test + run: xcrun llvm-cov export -format="lcov" .build/debug/${{ inputs.packagename }}PackageTests.xctest/Contents/MacOS/${{ inputs.packagename }}PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov + - name: Upload coverage to Codecov + if: matrix.configuration == 'debug' && inputs.test + uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/.github/workflows/build-and-test-xcodebuild-spm.yml b/.github/workflows/build-and-test-xcodebuild-spm.yml new file mode 100644 index 0000000..9dcc457 --- /dev/null +++ b/.github/workflows/build-and-test-xcodebuild-spm.yml @@ -0,0 +1,56 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Build and Test Swift Package using Xcodebuild + +on: + workflow_call: + inputs: + path: + description: 'The path where the Swift Package is located. Defaults to $GITHUB_WORKSPACE' + required: false + type: string + default: '.' + scheme: + description: 'Name of the Scheme used to build the Swift Package' + required: false + type: string + default: '' + +jobs: + build_and_test: + name: Build and Test Swift Package + runs-on: macos-12 + defaults: + run: + working-directory: ${{ inputs.path }} + steps: + - uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Check Environment + run: | + xcodebuild -version + swift --version + echo "inputs.path: ${{ inputs.path }}" + echo "inputs.scheme: ${{ inputs.scheme }}" + - name: Build and Test + run: | + xcodebuild test \ + -scheme ${{ inputs.scheme }} \ + -sdk iphonesimulator \ + -destination "name=iPhone 14 Pro Max" \ + -enableCodeCoverage YES \ + -resultBundlePath ${{ inputs.scheme }}.xcresult \ + CODE_SIGNING_ALLOWED="NO" + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.scheme }}.xcresult + path: ${{ inputs.scheme }}.xcresult diff --git a/.github/workflows/build-and-test-xcodebuild.yml b/.github/workflows/build-and-test-xcodebuild.yml new file mode 100644 index 0000000..026bd3b --- /dev/null +++ b/.github/workflows/build-and-test-xcodebuild.yml @@ -0,0 +1,61 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Build and Test iOS Application Xcodebuild + +on: + workflow_call: + inputs: + path: + description: 'The path where the Swift Package is located. Defaults to $GITHUB_WORKSPACE' + required: false + type: string + default: '.' + xcodeprojname: + description: 'The name of the Xcode project used to build the iOS application' + required: true + type: string + scheme: + description: 'The scheme in the Xcode project' + required: true + type: string + +jobs: + build_and_test: + name: Build and Test iOS Application + runs-on: macos-12 + defaults: + run: + working-directory: ${{ inputs.path }} + steps: + - uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Check Environment + run: | + xcodebuild -version + swift --version + echo "inputs.xcodeprojname: ${{ inputs.xcodeprojname }}" + echo "inputs.scheme: ${{ inputs.scheme }}" + - name: Build and Test Example App + run: | + xcodebuild test \ + -project ${{ inputs.xcodeprojname }} \ + -scheme ${{ inputs.scheme }} \ + -destination 'name=iPhone 14 Pro Max' \ + -enableCodeCoverage YES \ + -resultBundlePath ${{ inputs.scheme }}.xcresult \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO + - name: Upload Artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.scheme }}.xcresult + path: ${{ inputs.scheme }}.xcresult diff --git a/.github/workflows/create-and-upload-coverage-report.yml b/.github/workflows/create-and-upload-coverage-report.yml new file mode 100644 index 0000000..263d782 --- /dev/null +++ b/.github/workflows/create-and-upload-coverage-report.yml @@ -0,0 +1,47 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Create and Upload Coverage Report + +on: + workflow_call: + inputs: + coveragereports: + description: 'A string containing all names of the .xcresult files that are downloaded from the artifacts of previous jobs.' + required: true + type: string + secrets: + token: + description: 'The CodeCov token used for private repositories' + required: false + +jobs: + create-and-upload-coverage-report: + name: Create and Upload Coverage Report + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Check Environment + run: | + xcodebuild -version + swift --version + - uses: actions/download-artifact@v3 + - name: Merge Coverage Reports + run: | + xcrun xcresulttool merge ${{ inputs.coveragereports }} --output-path CodeCoverage.xcresult + rm -rf ${{ inputs.coveragereports }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + token: ${{ secrets.token }} + xcode: true + xcode_archive_path: CodeCoverage.xcresult \ No newline at end of file diff --git a/.github/workflows/docker-build-and-push b/.github/workflows/docker-build-and-push new file mode 100644 index 0000000..7ac34e9 --- /dev/null +++ b/.github/workflows/docker-build-and-push @@ -0,0 +1,118 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Docker Build and Push + +on: + workflow_call: + inputs: + docker-file: + description: 'Path or name of the Docker file. The default values is `Dockerfile`. The docker file can use the `baseimage` to get an architecture specific Swift base image' + required: false + type: string + default: 'Dockerfile' + image-name: + description: 'The name used to tag the docker image on ghcr.io containing the organzation/account name and the name of the image, e.g.: apodini/example' + required: true + type: string + working-directory: + description: 'The working-directory of the GitHub Action. Defaults to $GITHUB_WORKSPACE' + required: false + type: string + default: '.' + +jobs: + dockerARM64: + name: Docker Build and Push Image ARM64 + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ inputs.working-directory }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Get latest tag + id: latesttag + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: latest + - name: Log in to the container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push docker image + id: buildandpush + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/arm64 + file: ${{ inputs.docker-file }} + push: true + tags: ghcr.io/${{ inputs.image-name }}:latest-arm64,ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }}-arm64 + dockerAMD64: + name: Docker Build and Push Image AMD64 + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ inputs.working-directory }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Get latest tag + id: latesttag + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: latest + - name: Log in to the container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push docker image + id: buildandpush + uses: docker/build-push-action@v3 + with: + context: . + file: ${{ inputs.docker-file }} + push: true + tags: ghcr.io/${{ inputs.image-name }}:latest-amd64,ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }}-amd64 + dockermanifest: + needs: [dockerARM64, dockerAMD64] + name: Create Multi-CPU Architecture Image + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Get latest tag + id: latesttag + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: latest + - name: Log in to the container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create and Push Multi Architecture Image + run: | + docker manifest create ghcr.io/${{ inputs.image-name }}:latest \ + --amend ghcr.io/${{ inputs.image-name }}:latest-amd64 \ + --amend ghcr.io/${{ inputs.image-name }}:latest-arm64 + docker manifest create ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }} \ + --amend ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }}-amd64 \ + --amend ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }}-arm64 + docker manifest push ghcr.io/${{ inputs.image-name }}:latest + docker manifest push ghcr.io/${{ inputs.image-name }}:${{ steps.latesttag.outputs.tag }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..b5bceda --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,89 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Generate DocC Documentation Using the Swift Package Manager + +on: + workflow_call: + inputs: + scheme: + description: 'Name of the Scheme used to build the documentation' + required: false + type: string + default: '' + targetname: + description: 'Name of the Swift Package Manager target using DocC' + required: true + type: string + usexcodebuild: + description: 'A flag indicating if the DocC documentation should be generated using DocC' + required: false + type: boolean + default: true + +jobs: + generate: + name: Generate DocC Documentation + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: actions/cache@v2 + if: inputs.usexcodebuild == false + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + - name: Check Environment + run: | + xcodebuild -version + swift --version + echo "inputs.scheme: ${{ inputs.scheme }}" + echo "inputs.targetname: ${{ inputs.targetname }}" + echo "github.event.repository.name: ${{ github.event.repository.name }}" + - name: Generate Documentation + if: inputs.usexcodebuild == false + run: | + swift package --allow-writing-to-directory ./docs \ + generate-documentation --target ${{ inputs.targetname }} \ + --disable-indexing \ + --transform-for-static-hosting \ + --hosting-base-path ${{ github.event.repository.name }} \ + --output-path ./docs + - name: Generate Documentation Using Xcodebuild + if: inputs.usexcodebuild + run: | + INPUT_SCHEME=${{ inputs.scheme }} + SCHEME=${INPUT_SCHEME:-"${{ inputs.targetname }}-Package"} + xcodebuild docbuild \ + -scheme $SCHEME \ + -sdk iphonesimulator \ + -destination "name=iPhone 14 Pro Max" \ + -derivedDataPath .xcodebuild/ \ + CODE_SIGNING_ALLOWED="NO" + xcrun docc process-archive \ + transform-for-static-hosting .xcodebuild/Build/Products/Debug-iphonesimulator/${{ inputs.targetname }}.doccarchive \ + --hosting-base-path ${{ github.event.repository.name }} \ + --output-path ./docs + - uses: actions/upload-pages-artifact@v1 + with: + path: ./docs + deploy: + name: Deploy to GitHub Pages + needs: generate + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000..01ea66f --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,22 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: REUSE Compliance Check + +on: + pull_request: + workflow_call: + +jobs: + reuse: + name: REUSE Compliance Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: REUSE Compliance Check + uses: fsfe/reuse-action@v1 diff --git a/.github/workflows/spm-update.yml b/.github/workflows/spm-update.yml new file mode 100644 index 0000000..928a98d --- /dev/null +++ b/.github/workflows/spm-update.yml @@ -0,0 +1,72 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Swift Package Update + +on: + workflow_call: + inputs: + author: + description: 'The author of the resulting PR containing the updated Swift package' + required: false + type: string + default: PaulsAutomationBot + reviewers: + description: 'The reviewers of the resulting pull request containing the updated Swift package' + required: false + type: string + default: PSchmiedmayer + branch: + description: 'The branch that should be used to create the pull request' + required: false + type: string + default: bots/update-dependencies + secrets: + token: + description: 'The Personal Access Token with permissions to push to the repository. Unfortunately, the GITHUB_TOKEN does not trigger GitHub Actions in the resulting pull request.' + required: true + +jobs: + createPR: + name: Create Pull Request + container: + image: swift:focal + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check Environment + run: | + swift --version + echo "inputs.author: ${{ inputs.author }}" + echo "inputs.reviewers: ${{ inputs.reviewers }}" + echo "inputs.branch: ${{ inputs.branch }}" + - name: Update Swift Packages + run: swift package update + - name: Add Safe Directory + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - uses: peter-evans/create-pull-request@v4 + id: cpr + with: + token: ${{ secrets.token }} + commit-message: Update dependencies + title: Update Dependencies + body: Update the Swift Package Manager dependencies. + delete-branch: true + base: develop + branch: bots/update-dependencies + assignees: ${{ inputs.author }} + committer: ${{ inputs.author }} <${{ inputs.author }}@users.noreply.github.com> + author: ${{ inputs.author }} <${{ inputs.author }}@users.noreply.github.com> + reviewers: ${{ inputs.reviewers }} + - name: Enable Pull Request Automerge + if: steps.cpr.outputs.pull-request-operation == 'created' + uses: peter-evans/enable-pull-request-automerge@v2 + with: + token: ${{ secrets.token }} + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} + merge-method: squash diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 0000000..7026f8c --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,26 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: SwiftLint + +on: + workflow_call: + +jobs: + swiftlint: + name: SwiftLint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SwiftLint + uses: sinoru/actions-swiftlint@v6 + with: + swiftlint-version: '0.50.0-rc.2' + swiftlint-args: --strict diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b19446 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +.DS_Store +.env diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..936609d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,142 @@ + + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Using welcoming and inclusive language +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at cardinalkit@stanford.edu. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f706be5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ + + +# Contributing Guidelines + +Thank you for contributing to the Stanford Biodesign for Digital Health project! We value the time and effort you invest in the open-source project! + +We use [GitHub Discussions](https://docs.github.com/en/discussions) at [https://github.com/orgs/StanfordBDHG/discussions](https://github.com/orgs/StanfordBDHG/discussions) for any discussions about the project. +Please follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md). + +We use the [Github Flow](https://guides.github.com/introduction/flow/index.html) for all code-related contributions. +GitHub discussions are the best way to brainstorm your suggestions. +GitHub issues are the best way to document decisions or bugs. +Pull requests are the best way to propose changes to the codebase. + +## Licensing + +Your submissions must be published and conform to the license currently used in the respective repository. + +## Bug Reporting + +We use GitHub issues to track public bugs. Report a bug by opening a new issue using the bug issue template. + +## Support Policy + +Please refer to our [Support Policy](https://github.com/StanfordBDHG/.github/blob/main/SUPPORT.md) for information about getting support. + +## Security Policy + +For security and vulnerability-related issues, please refer to our [Support Policy](https://github.com/StanfordBDHG/.github/blob/main/SUPPORT.md). \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..87d1665 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,14 @@ + + +# Stanford Biodesign for Digital Health .github Contributors + +* [Vishnu Ravi](https://github.com/vishnuravi) +* [Paul Schmiedmayer](https://github.com/PSchmiedmayer) diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 0000000..9060a13 --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1,9 @@ +# +# This source file is part of the Stanford Biodesign for Digital Health open-source project +# +# SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +custom: [Stanford Biodesign for Digital Health.stanford.edu] \ No newline at end of file diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..11e5a38 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..92d2127 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ + + +# .github + +This repository serves as a collection of default community health files, GitHub Action workflows, templates, and information for the Stanford Biodesign for Digital Health organization. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..c5bb6fd --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,16 @@ + + +# Security Policy + +Please report security vulnerabilities to the Stanford Biodesign for Digital Health team at cardinalkit@stanford.edu. +We highly value your input and will get back to you as soon as possible. Please include steps to reproduce, context, and any further information that makes identifying and resolving the vulnerability as quickly as possible. + +See the [The CERT Guide to Coordinated Vulnerability Disclosure](https://vuls.cert.org/confluence/display/CVD/The+CERT+Guide+to+Coordinated+Vulnerability+Disclosure) for additional background information about the coordinated vulnerability disclosure process. \ No newline at end of file diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000..5593412 --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,18 @@ + + +# Support Policy + +We use [GitHub Discussions](https://docs.github.com/en/discussions) for any questions that you have about the project. +Please use [https://github.com/orgs/StanfordBDHG/discussions](https://github.com/orgs/StanfordBDHG/discussions) to ask questions, share your Digital Health projects, and follow announcements. + +Please follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md). + +Please refer to our [Security Policy](https://github.com/StanfordBDHG/.github/blob/main/SECURITY.md) for all security-related issues. \ No newline at end of file diff --git a/assets/biodesign-footer-dark.png b/assets/biodesign-footer-dark.png new file mode 100644 index 0000000..3aa21c9 Binary files /dev/null and b/assets/biodesign-footer-dark.png differ diff --git a/assets/biodesign-footer-dark.png.license b/assets/biodesign-footer-dark.png.license new file mode 100644 index 0000000..3954213 --- /dev/null +++ b/assets/biodesign-footer-dark.png.license @@ -0,0 +1,5 @@ +This source file is part of the Stanford Biodesign for Digital Health open-source project + +SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) + +SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/assets/biodesign-footer-light.png b/assets/biodesign-footer-light.png new file mode 100644 index 0000000..cbc47e4 Binary files /dev/null and b/assets/biodesign-footer-light.png differ diff --git a/assets/biodesign-footer-light.png.license b/assets/biodesign-footer-light.png.license new file mode 100644 index 0000000..3954213 --- /dev/null +++ b/assets/biodesign-footer-light.png.license @@ -0,0 +1,5 @@ +This source file is part of the Stanford Biodesign for Digital Health open-source project + +SPDX-FileCopyrightText: 2022 Stanford Biodesign for Digital Health and the project authors (see CONTRIBUTORS.md) + +SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/profile/README.md b/profile/README.md new file mode 100644 index 0000000..2473546 --- /dev/null +++ b/profile/README.md @@ -0,0 +1,16 @@ + + +### Stanford Biodesign for Digital Health + +For more information, check out our website at [biodesign.stanford.edu](https://biodesign.stanford.edu). + +![Stanford Byers Center for Biodesign Logo](https://raw.githubusercontent.com/StanfordBDHG/.github/main/assets/biodesign-footer-light.png#gh-light-mode-only) +![Stanford Byers Center for Biodesign Logo](https://raw.githubusercontent.com/StanfordBDHG/.github/main/assets/biodesign-footer-dark.png#gh-dark-mode-only)