Skip to content
Merged
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
99 changes: 99 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
## Description

<!-- Provide a brief description of the changes in this PR -->

## Type of Change

<!-- Check the type that applies to this PR -->

- [ ] πŸ› Bug fix (fixes an issue)
- [ ] ✨ New feature (adds functionality)
- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] πŸ“ Documentation update
- [ ] 🎨 Code style/formatting
- [ ] ♻️ Code refactoring (no functional changes)
- [ ] βœ… Test updates
- [ ] πŸ”§ Build/config changes

## Package Scope

<!-- Check which package(s) this PR affects -->

- [ ] JEngine.Core (`com.jasonxudeveloper.jengine.core`)
- [ ] JEngine.Util (`com.jasonxudeveloper.jengine.util`)
- [ ] Other (specify):

## Checklist

- [ ] My code follows the project's coding conventions (see [CLAUDE.md](../CLAUDE.md))
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added/updated XML documentation for public APIs
- [ ] I have added/updated tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have used `UniTask` for async operations (not `System.Threading.Tasks.Task`)
- [ ] My changes handle Unity domain reloads properly (if applicable to Editor code)

## Commit Message Format

We use **Conventional Commits** for automated changelog generation. Please format your commit messages as:

```
<type>(<scope>): <subject>
```

### Examples

```bash
feat(core): add ChaCha20 encryption support
fix(util): resolve JAction memory leak on cancellation
docs: update installation guide for Unity 2022.3
refactor(core): simplify bootstrap initialization
test(util): add coverage for JAction edge cases
chore(ci): update GameCI Unity version to 2022.3.55f1
```

### Types

- `feat:` - New feature (appears in changelog)
- `fix:` - Bug fix (appears in changelog)
- `docs:` - Documentation only
- `style:` - Code style/formatting
- `refactor:` - Code refactoring
- `test:` - Test changes
- `chore:` - Build/config changes

### Scopes

- `core` - JEngine.Core package
- `util` - JEngine.Util package
- `ci` - CI/CD workflows
- `docs` - Documentation

### Breaking Changes

For breaking changes, add `!` after the type/scope or include `BREAKING CHANGE:` in the footer:

```bash
feat(core)!: redesign encryption API

BREAKING CHANGE: EncryptionManager.Encrypt() now requires EncryptionConfig parameter
```

## Testing

<!-- Describe how you tested your changes -->

**Test environment:**
- Unity version:
- Platform(s):
- Test mode: [ ] EditMode [ ] PlayMode [ ] Manual

**Steps to test:**
1.
2.
3.

## Additional Notes

<!-- Any additional information that reviewers should know -->
100 changes: 100 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: PR Tests

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'UnityProject/Packages/com.jasonxudeveloper.jengine.core/**'
- 'UnityProject/Packages/com.jasonxudeveloper.jengine.util/**'
- 'UnityProject/Assets/Tests/**'
- '.github/workflows/**'

# Ensure only one test run per PR at a time
concurrency:
group: pr-tests-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
run-tests:
name: Run Unity Tests
uses: ./.github/workflows/unity-tests.yml
secrets: inherit

comment-results:
name: Comment Test Results
needs: run-tests
runs-on: ubuntu-latest
if: always()
permissions:
pull-requests: write
statuses: write

steps:
- name: Comment PR with test results
uses: actions/github-script@v7
with:
script: |
const testResults = `${{ needs.run-tests.outputs.test_results }}`;
const jobStatus = '${{ needs.run-tests.result }}';

let comment = testResults;

if (jobStatus === 'success') {
comment += '\n\nβœ… All tests passed! The PR is ready for review.';
} else if (jobStatus === 'failure') {
comment += '\n\n❌ Some tests failed. Please fix the failing tests before merging.';
} else {
comment += '\n\n⚠️ Test execution was cancelled or encountered an error.';
}

comment += `\n\n<details><summary>View workflow run</summary>\n\n[Click here to view the full workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n</details>`;

// Find existing comment
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Unity Test Results')
);

if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: comment
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment
});
}

- name: Set PR check status
uses: actions/github-script@v7
with:
script: |
const jobStatus = '${{ needs.run-tests.result }}';
const state = jobStatus === 'success' ? 'success' : 'failure';
const description = jobStatus === 'success'
? 'All Unity tests passed'
: 'Unity tests failed';

await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.pull_request.head.sha,
state: state,
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
description: description,
context: 'Unity Tests'
});
Loading
Loading