-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (75 loc) · 2.2 KB
/
test.yml
File metadata and controls
95 lines (75 loc) · 2.2 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
name: Tests
on:
push:
branches: [ main, master, develop, claude/** ]
pull_request:
branches: [ main, master, develop ]
jobs:
test:
name: Crystal ${{ matrix.crystal }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crystal:
- 1.10.1
- 1.14.0
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Cache shards
uses: actions/cache@v4
with:
path: |
lib
.shards
key: ${{ runner.os }}-shards-${{ hashFiles('**/shard.lock') }}
restore-keys: |
${{ runner.os }}-shards-
- name: Install dependencies
run: shards install
- name: Run specs
run: crystal spec --error-trace --verbose
- name: Build library
run: crystal build --no-codegen src/oak.cr
compatibility:
name: Compatibility Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.14.0
- name: Install dependencies
run: shards install
- name: Verify no syntax errors
run: crystal build --no-codegen src/oak.cr
- name: Run all specs
run: crystal spec --error-trace
summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test, compatibility]
if: always()
steps:
- name: Check status
run: |
echo "::group::Test Results"
echo "Main Tests: ${{ needs.test.result }}"
echo "Compatibility: ${{ needs.compatibility.result }}"
echo "::endgroup::"
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "::error::Tests failed on one or more Crystal versions"
exit 1
fi
if [[ "${{ needs.compatibility.result }}" != "success" ]]; then
echo "::error::Compatibility check failed"
exit 1
fi
echo "::notice::✅ All tests passed successfully!"