Skip to content

Commit 83afad8

Browse files
committed
Merge branch 'master' of ssh://github.com/obsidian/oak
2 parents 7437e74 + cd6667f commit 83afad8

File tree

17 files changed

+1385
-136
lines changed

17 files changed

+1385
-136
lines changed

.github/workflows/ci.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop, claude/** ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
9+
jobs:
10+
test:
11+
name: Test on Crystal ${{ matrix.crystal }} - ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest]
18+
crystal:
19+
- 1.10.1
20+
- 1.9.2
21+
- 1.14.0
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Install Crystal
28+
uses: crystal-lang/install-crystal@v1
29+
with:
30+
crystal: ${{ matrix.crystal }}
31+
32+
- name: Install dependencies
33+
run: shards install
34+
35+
- name: Check formatting
36+
run: crystal tool format --check
37+
continue-on-error: true
38+
39+
- name: Run tests
40+
run: crystal spec --error-trace
41+
42+
- name: Build project
43+
run: crystal build --no-codegen src/oak.cr
44+
45+
benchmark:
46+
name: Benchmark Performance
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
53+
- name: Install Crystal
54+
uses: crystal-lang/install-crystal@v1
55+
with:
56+
crystal: 1.14.0
57+
58+
- name: Install dependencies
59+
run: shards install
60+
61+
- name: Build benchmark (release mode)
62+
run: crystal build --release benchmark -o benchmark_binary
63+
continue-on-error: true
64+
65+
- name: Run benchmark validation
66+
run: |
67+
if [ -f benchmark_binary ]; then
68+
echo "Benchmark binary built successfully"
69+
# Quick smoke test (don't run full benchmark in CI)
70+
echo "Benchmark is ready to run"
71+
else
72+
echo "Benchmark build skipped or failed"
73+
fi
74+
continue-on-error: true
75+
76+
lint:
77+
name: Code Quality
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v4
83+
84+
- name: Install Crystal
85+
uses: crystal-lang/install-crystal@v1
86+
with:
87+
crystal: 1.14.0
88+
89+
- name: Install dependencies
90+
run: shards install
91+
92+
- name: Run Ameba (linter)
93+
run: |
94+
if shards info ameba >/dev/null 2>&1; then
95+
crystal run lib/ameba/src/cli.cr -- --all
96+
else
97+
echo "Ameba not installed, skipping lint"
98+
fi
99+
continue-on-error: true
100+
101+
coverage:
102+
name: Code Coverage
103+
runs-on: ubuntu-latest
104+
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v4
108+
109+
- name: Install Crystal
110+
uses: crystal-lang/install-crystal@v1
111+
with:
112+
crystal: 1.14.0
113+
114+
- name: Install dependencies
115+
run: shards install
116+
117+
- name: Generate coverage report
118+
run: |
119+
echo "Running tests with coverage..."
120+
crystal spec --error-trace
121+
echo "Coverage report would be generated here"
122+
continue-on-error: true
123+
124+
docs:
125+
name: Documentation Build
126+
runs-on: ubuntu-latest
127+
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v4
131+
132+
- name: Install Crystal
133+
uses: crystal-lang/install-crystal@v1
134+
with:
135+
crystal: 1.14.0
136+
137+
- name: Generate documentation
138+
run: crystal docs
139+
140+
- name: Upload documentation
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: documentation
144+
path: docs/
145+
retention-days: 7
146+
147+
status:
148+
name: CI Status
149+
runs-on: ubuntu-latest
150+
needs: [test, benchmark, lint]
151+
if: always()
152+
153+
steps:
154+
- name: Check CI Results
155+
run: |
156+
echo "Test Status: ${{ needs.test.result }}"
157+
echo "Benchmark Status: ${{ needs.benchmark.result }}"
158+
echo "Lint Status: ${{ needs.lint.result }}"
159+
160+
if [ "${{ needs.test.result }}" != "success" ]; then
161+
echo "❌ Tests failed!"
162+
exit 1
163+
fi
164+
165+
echo "✅ All critical checks passed!"

.github/workflows/test.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop, claude/** ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
9+
jobs:
10+
test:
11+
name: Crystal ${{ matrix.crystal }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
crystal:
18+
- 1.10.1
19+
- 1.14.0
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install Crystal
26+
uses: crystal-lang/install-crystal@v1
27+
with:
28+
crystal: ${{ matrix.crystal }}
29+
30+
- name: Cache shards
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
lib
35+
.shards
36+
key: ${{ runner.os }}-shards-${{ hashFiles('**/shard.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-shards-
39+
40+
- name: Install dependencies
41+
run: shards install
42+
43+
- name: Run specs
44+
run: crystal spec --error-trace --verbose
45+
46+
- name: Build library
47+
run: crystal build --no-codegen src/oak.cr
48+
49+
compatibility:
50+
name: Compatibility Check
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
56+
57+
- name: Install Crystal
58+
uses: crystal-lang/install-crystal@v1
59+
with:
60+
crystal: 1.14.0
61+
62+
- name: Install dependencies
63+
run: shards install
64+
65+
- name: Verify no syntax errors
66+
run: crystal build --no-codegen src/oak.cr
67+
68+
- name: Run all specs
69+
run: crystal spec --error-trace
70+
71+
summary:
72+
name: Test Summary
73+
runs-on: ubuntu-latest
74+
needs: [test, compatibility]
75+
if: always()
76+
77+
steps:
78+
- name: Check status
79+
run: |
80+
echo "::group::Test Results"
81+
echo "Main Tests: ${{ needs.test.result }}"
82+
echo "Compatibility: ${{ needs.compatibility.result }}"
83+
echo "::endgroup::"
84+
85+
if [[ "${{ needs.test.result }}" != "success" ]]; then
86+
echo "::error::Tests failed on one or more Crystal versions"
87+
exit 1
88+
fi
89+
90+
if [[ "${{ needs.compatibility.result }}" != "success" ]]; then
91+
echo "::error::Compatibility check failed"
92+
exit 1
93+
fi
94+
95+
echo "::notice::✅ All tests passed successfully!"

0 commit comments

Comments
 (0)