Skip to content

Commit 6ba45a4

Browse files
authored
Merge pull request #4 from kavyasoni/claude/sapphire-production-upgrade-01ULuAjCGDNn8BLYRiyj9n1a
Claude/sapphire production upgrade 01 u lu aj cgd nn8 bly riyj9n1a
2 parents 0ab54e8 + 4f1c3c8 commit 6ba45a4

23 files changed

Lines changed: 4548 additions & 82 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve Sapphire
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
A clear and concise description of what the bug is.
11+
12+
## To Reproduce
13+
Steps to reproduce the behavior:
14+
1. Initialize driver with '...'
15+
2. Call method '...'
16+
3. See error
17+
18+
## Expected Behavior
19+
A clear and concise description of what you expected to happen.
20+
21+
## Actual Behavior
22+
What actually happened.
23+
24+
## Code Sample
25+
```java
26+
// Minimal code to reproduce the issue
27+
```
28+
29+
## Environment
30+
- **Sapphire Version:** [e.g., 2.0.0]
31+
- **Java Version:** [e.g., 17]
32+
- **Appium Version:** [e.g., 2.5.0]
33+
- **Platform:** [e.g., Android 13, iOS 16]
34+
- **Device:** [e.g., Pixel 6, iPhone 14]
35+
- **OS:** [e.g., macOS 13, Ubuntu 22.04]
36+
37+
## Logs
38+
```
39+
Paste relevant logs here
40+
```
41+
42+
## Screenshots
43+
If applicable, add screenshots to help explain your problem.
44+
45+
## Additional Context
46+
Add any other context about the problem here.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for Sapphire
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
A clear and concise description of the feature you'd like to see.
11+
12+
## Problem It Solves
13+
Is your feature request related to a problem? Please describe.
14+
15+
## Proposed Solution
16+
Describe the solution you'd like.
17+
18+
## Alternatives Considered
19+
Describe alternatives you've considered.
20+
21+
## Example Usage
22+
```java
23+
// How you envision using this feature
24+
```
25+
26+
## Benefits
27+
- Who will benefit from this feature?
28+
- What are the advantages?
29+
30+
## Additional Context
31+
Add any other context, mockups, or examples about the feature request here.

.github/pull_request_template.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Description
2+
Brief description of the changes in this PR.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Code refactoring
10+
- [ ] Performance improvement
11+
- [ ] Test addition/improvement
12+
13+
## Related Issues
14+
Fixes #(issue number)
15+
16+
## Changes Made
17+
- Change 1
18+
- Change 2
19+
- Change 3
20+
21+
## Testing
22+
### How has this been tested?
23+
- [ ] Unit tests
24+
- [ ] Integration tests
25+
- [ ] Manual testing
26+
27+
### Test configuration:
28+
- Java version:
29+
- Appium version:
30+
- Platform/Device:
31+
32+
## Checklist
33+
- [ ] My code follows the style guidelines of this project
34+
- [ ] I have performed a self-review of my own code
35+
- [ ] I have commented my code, particularly in hard-to-understand areas
36+
- [ ] I have made corresponding changes to the documentation
37+
- [ ] My changes generate no new warnings
38+
- [ ] I have added tests that prove my fix is effective or that my feature works
39+
- [ ] New and existing unit tests pass locally with my changes
40+
- [ ] Any dependent changes have been merged and published
41+
42+
## Screenshots (if applicable)
43+
Add screenshots to help explain your changes.
44+
45+
## Additional Notes
46+
Any additional information that reviewers should know.

.github/workflows/ci.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
name: Sapphire CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop, 'claude/**' ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test:
12+
name: Build and Test
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest]
17+
java: [17, 21]
18+
fail-fast: false
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up JDK ${{ matrix.java }}
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: ${{ matrix.java }}
28+
distribution: 'temurin'
29+
cache: 'maven'
30+
31+
- name: Cache Maven packages
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.m2
35+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: ${{ runner.os }}-m2
37+
38+
- name: Build with Maven
39+
run: mvn clean compile -B
40+
41+
- name: Run unit tests
42+
run: mvn test -B -Dgroups=unit
43+
44+
- name: Generate test report
45+
if: always()
46+
uses: dorny/test-reporter@v1
47+
with:
48+
name: Test Results (${{ matrix.os }}, Java ${{ matrix.java }})
49+
path: target/surefire-reports/*.xml
50+
reporter: java-junit
51+
fail-on-error: false
52+
53+
- name: Generate code coverage report
54+
run: mvn jacoco:report
55+
56+
- name: Upload coverage to Codecov
57+
uses: codecov/codecov-action@v4
58+
with:
59+
file: ./target/site/jacoco/jacoco.xml
60+
flags: unittests
61+
name: codecov-${{ matrix.os }}-java${{ matrix.java }}
62+
fail_ci_if_error: false
63+
64+
- name: Archive test reports
65+
if: always()
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: test-reports-${{ matrix.os }}-java${{ matrix.java }}
69+
path: |
70+
target/surefire-reports/
71+
target/site/jacoco/
72+
logs/
73+
retention-days: 30
74+
75+
code-quality:
76+
name: Code Quality Checks
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v4
82+
83+
- name: Set up JDK 17
84+
uses: actions/setup-java@v4
85+
with:
86+
java-version: 17
87+
distribution: 'temurin'
88+
cache: 'maven'
89+
90+
- name: Run Checkstyle
91+
run: mvn checkstyle:check -B
92+
continue-on-error: true
93+
94+
- name: Run PMD
95+
run: mvn pmd:check -B
96+
continue-on-error: true
97+
98+
- name: Run SpotBugs
99+
run: mvn spotbugs:check -B
100+
continue-on-error: true
101+
102+
- name: Upload code quality reports
103+
if: always()
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: code-quality-reports
107+
path: |
108+
target/checkstyle-result.xml
109+
target/pmd.xml
110+
target/spotbugsXml.xml
111+
retention-days: 30
112+
113+
dependency-check:
114+
name: Dependency Security Scan
115+
runs-on: ubuntu-latest
116+
117+
steps:
118+
- name: Checkout code
119+
uses: actions/checkout@v4
120+
121+
- name: Set up JDK 17
122+
uses: actions/setup-java@v4
123+
with:
124+
java-version: 17
125+
distribution: 'temurin'
126+
cache: 'maven'
127+
128+
- name: Run dependency check
129+
run: mvn org.owasp:dependency-check-maven:check -B
130+
continue-on-error: true
131+
132+
- name: Upload dependency check report
133+
if: always()
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: dependency-check-report
137+
path: target/dependency-check-report.html
138+
retention-days: 30
139+
140+
build-artifact:
141+
name: Build Artifact
142+
runs-on: ubuntu-latest
143+
needs: [build-and-test]
144+
145+
steps:
146+
- name: Checkout code
147+
uses: actions/checkout@v4
148+
149+
- name: Set up JDK 17
150+
uses: actions/setup-java@v4
151+
with:
152+
java-version: 17
153+
distribution: 'temurin'
154+
cache: 'maven'
155+
156+
- name: Build package
157+
run: mvn clean package -DskipTests -B
158+
159+
- name: Upload artifact
160+
uses: actions/upload-artifact@v4
161+
with:
162+
name: sapphire-jar
163+
path: target/sapphire-*.jar
164+
retention-days: 30
165+
166+
integration-tests:
167+
name: Integration Tests (Headless)
168+
runs-on: ubuntu-latest
169+
needs: [build-and-test]
170+
171+
steps:
172+
- name: Checkout code
173+
uses: actions/checkout@v4
174+
175+
- name: Set up JDK 17
176+
uses: actions/setup-java@v4
177+
with:
178+
java-version: 17
179+
distribution: 'temurin'
180+
cache: 'maven'
181+
182+
- name: Set up Node.js for Appium
183+
uses: actions/setup-node@v4
184+
with:
185+
node-version: '20'
186+
187+
- name: Install Appium
188+
run: |
189+
npm install -g appium@next
190+
appium driver install uiautomator2
191+
192+
- name: Set up Android SDK
193+
uses: android-actions/setup-android@v3
194+
195+
- name: Create Android Emulator
196+
run: |
197+
echo "y" | sdkmanager "system-images;android-33;google_apis;x86_64"
198+
echo "no" | avdmanager create avd -n test_emulator -k "system-images;android-33;google_apis;x86_64" --force
199+
continue-on-error: true
200+
201+
- name: Start Appium Server
202+
run: |
203+
appium &
204+
sleep 5
205+
continue-on-error: true
206+
207+
- name: Run integration tests
208+
run: mvn verify -Dgroups=integration -B
209+
continue-on-error: true
210+
211+
- name: Upload integration test reports
212+
if: always()
213+
uses: actions/upload-artifact@v4
214+
with:
215+
name: integration-test-reports
216+
path: |
217+
target/failsafe-reports/
218+
report/
219+
screenshots/
220+
retention-days: 30

0 commit comments

Comments
 (0)