forked from ArcadeData/arcadedb
-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (138 loc) Β· 6.17 KB
/
Copy pathtest-python-bindings.yml
File metadata and controls
166 lines (138 loc) Β· 6.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Test Python Bindings
on:
# Run on any push to any branch
push:
# Run on any pull request
pull_request:
# Allow being called by other workflows (e.g., release workflow)
workflow_call:
# Allow manual trigger
workflow_dispatch:
jobs:
test:
name: Test arcadedb-embedded (${{ matrix.platform }})
runs-on: ubuntu-latest
strategy:
# Don't cancel other matrix jobs if one fails
fail-fast: false
matrix:
platform: [linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64]
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up QEMU (for ARM64 emulation)
if: matrix.platform == 'linux/arm64'
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build and test arcadedb-embedded (${{ matrix.platform }})
run: |
cd bindings/python
echo "π¨ Building arcadedb-embedded for ${{ matrix.platform }}..."
./build.sh ${{ matrix.platform }}
- name: Extract wheel for additional testing
run: |
cd bindings/python
mkdir -p test-install
cp dist/*.whl test-install/
- name: Set up Python for host testing
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.11'
# Note: Java is NOT required for arcadedb-embedded (JRE is bundled)
# This package works without any external Java installation!
- name: Install wheel and test dependencies
run: |
cd bindings/python
pip install test-install/*.whl pytest pytest-cov requests
- name: Run pytest on host
id: pytest
run: |
cd bindings/python
echo "π§ͺ Testing arcadedb-embedded (with bundled JRE)..."
# Run pytest with verbose output
pytest tests/ -v --tb=short --color=yes 2>&1 | tee pytest-output.txt
# Check results
if grep -q "failed" pytest-output.txt; then
echo "β Tests FAILED"
exit 1
elif grep -q "passed" pytest-output.txt || grep -q "skipped" pytest-output.txt; then
echo "β
Tests PASSED"
# Count results
PASSED=$(grep -oP '\d+(?= passed)' pytest-output.txt || echo "0")
SKIPPED=$(grep -oP '\d+(?= skipped)' pytest-output.txt || echo "0")
FAILED=$(grep -oP '\d+(?= failed)' pytest-output.txt || echo "0")
echo "passed=$PASSED" >> $GITHUB_OUTPUT
echo "skipped=$SKIPPED" >> $GITHUB_OUTPUT
echo "failed=$FAILED" >> $GITHUB_OUTPUT
# Exit with error if any failures
if [ "$FAILED" != "0" ]; then
exit 1
fi
else
echo "β οΈ Unexpected test output"
exit 1
fi
- name: Generate test summary
if: always()
run: |
cd bindings/python
echo "## π§ͺ Test Results: arcadedb-embedded (${{ matrix.platform }})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.pytest.outcome }}" = "success" ]; then
echo "β
**Status**: PASSED" >> $GITHUB_STEP_SUMMARY
else
echo "β **Status**: FAILED" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| β
Passed | ${{ steps.pytest.outputs.passed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
echo "| βοΈ Skipped | ${{ steps.pytest.outputs.skipped || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
echo "| β Failed | ${{ steps.pytest.outputs.failed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Package Info:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Package**: arcadedb-embedded (~160MB)" >> $GITHUB_STEP_SUMMARY
echo "- **JRE**: Bundled (no Java installation required)" >> $GITHUB_STEP_SUMMARY
echo "- **Features**: All ArcadeDB features except gRPC wire protocol" >> $GITHUB_STEP_SUMMARY
- name: Upload test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || 'windows-amd64' }}
path: |
bindings/python/pytest-output.txt
bindings/python/.coverage
retention-days: 7
- name: Upload wheel artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wheel-${{ matrix.platform }}-test
path: bindings/python/dist/*.whl
retention-days: 7
# Summary job that checks all platforms
test-summary:
name: Test Summary
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test results
run: |
echo "## π― Overall Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.test.result }}" = "success" ]; then
echo "β
**All platforms passed testing!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The arcadedb-embedded package has been successfully built and tested." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Package**: arcadedb-embedded (~160MB with bundled JRE)" >> $GITHUB_STEP_SUMMARY
else
echo "β **Some platforms failed testing**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Please check the individual test jobs for details." >> $GITHUB_STEP_SUMMARY
exit 1
fi