Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is a comment. Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @shanthaneddula

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.swift @shanthaneddula

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
# *.swift user@example.com
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 🐛 Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment:**
- OS: [e.g. macOS 14.0]
- Swift Version: [e.g. 5.9]
- Xcode Version: [e.g. 15.0]
- Device: [e.g. MacBook Pro 2023]

**Additional context**
Add any other context about the problem here.

**Logs**
If applicable, please share relevant logs or error messages.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: GitHub Community Support
url: https://github.com/orgs/community/discussions
about: Please ask and answer questions here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: ✨ Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Implementation Notes**
If you have any specific implementation ideas or requirements, please describe them here.
38 changes: 38 additions & 0 deletions .github/branch-protection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Branch Protection Rules

branches:
- name: main
protection:
required_status_checks:
strict: true
contexts:
- "Build and Test"
- "Code Coverage"
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: true
enforce_admins: true
required_linear_history: true
allow_force_pushes: false
allow_deletions: false
block_creations: true
required_conversation_resolution: true

- name: dev
protection:
required_status_checks:
strict: true
contexts:
- "Build and Test"
- "Code Coverage"
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: false
enforce_admins: true
required_linear_history: true
allow_force_pushes: false
allow_deletions: false
block_creations: true
required_conversation_resolution: true
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

## Type of change
Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

## Additional Notes
Add any additional notes or screenshots here.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
build:
name: Build and Test
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Set up Swift
uses: fwal/setup-swift@v1
with:
swift-version: "5.9"

- name: Build
run: swift build -v

- name: Run Tests
run: swift test -v

- name: Run SwiftLint
run: |
brew install swiftlint
swiftlint lint --reporter codeclimate-logger | tee swiftlint-report.json

- name: Upload SwiftLint Report
uses: actions/upload-artifact@v4
with:
name: swiftlint-report
path: swiftlint-report.json
retention-days: 7

codecov:
name: Upload Coverage
needs: build
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Set up Swift
uses: fwal/setup-swift@v1
with:
swift-version: "5.9"

- name: Install Codecov
run: |
brew install codecov

- name: Generate Coverage
run: |
swift test --enable-code-coverage

- name: Upload Coverage
run: |
xcrun llvm-cov export -format="lcov" .build/debug/MinimalAIChatPackageTests.xctest/Contents/MacOS/MinimalAIChatPackageTests > coverage.lcov
codecov -f coverage.lcov -B main
41 changes: 41 additions & 0 deletions .github/workflows/dependency-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Dependency Update

on:
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight

jobs:
update:
name: Update Dependencies
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Set up Swift
uses: fwal/setup-swift@v1
with:
swift-version: "5.9"

- name: Update Dependencies
run: |
swift package update
if git diff --quiet Package.resolved; then
echo "No dependency updates available"
else
echo "Dependencies have updates available"
git diff Package.resolved
fi

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore: update dependencies"
title: "chore: update dependencies"
body: |
Automated dependency update.

This PR updates the project dependencies to their latest versions.

Please review the changes and merge if appropriate.
branch: chore/dependency-update
delete-branch: true
47 changes: 47 additions & 0 deletions .github/workflows/dependency-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Dependency Updates

on:
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday

jobs:
update-dependencies:
name: Update Dependencies
runs-on: macos-14
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up Swift
uses: fwal/setup-swift@v1
with:
swift-version: "5.9"

- name: Update Dependencies
run: |
swift package update
if git diff --quiet Package.resolved; then
echo "No dependency updates available"
else
echo "Dependencies have updates available"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Package.resolved
git commit -m "Update dependencies"
git push
fi

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Update dependencies"
title: "Update dependencies"
body: |
Automated dependency updates.

This PR was created automatically by the dependency update workflow.
branch: dependency-updates
delete-branch: true
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Build Release
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Set up Swift
uses: fwal/setup-swift@v1
with:
swift-version: "5.9"

- name: Build
run: swift build -c release

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/release/MinimalAIChat
asset_name: MinimalAIChat-${{ github.ref_name }}
asset_content_type: application/octet-stream
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.9
14 changes: 14 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--indent 4
--allman false
--wraparguments before-first
--wrapcollections before-first
--closingparen same-line
--commas always
--comments indent
--semicolons never
--trimwhitespace always
--header strip
--maxwidth 120
--wrapparameters before-first
--importgrouping testable-bottom
--xcodeindentation enabled
Loading
Loading