-
Notifications
You must be signed in to change notification settings - Fork 7
129 lines (106 loc) · 3.31 KB
/
Copy pathci.yml
File metadata and controls
129 lines (106 loc) · 3.31 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
name: CI
on:
push:
branches: [ main, enhs ]
pull_request:
branches: [ main ]
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run shellcheck on setup-yolo.sh
run: shellcheck setup-yolo.sh
- name: Run shellcheck on bin/yolo
run: shellcheck bin/yolo
unit-tests:
name: Unit Tests (BATS)
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install bats
run: |
if command -v brew &>/dev/null; then
brew install bats-core
else
sudo apt-get update && sudo apt-get install -y bats
fi
- name: Run tests
run: bats tests/
test-setup:
name: Test Setup Script
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install podman
run: |
sudo apt-get update
sudo apt-get install -y podman
- name: Test setup-yolo.sh (build only)
run: |
# Run setup with no input to skip installation prompt
# This will build the image and exit when asking about installation
echo "n" | ./setup-yolo.sh || true
# Verify the image was built
podman image exists con-bomination-claude-code
- name: Verify yolo script syntax
run: |
bash -n bin/yolo
echo "✓ Yolo script has valid syntax"
- name: Test yolo script help (dry run)
run: |
# Create a mock podman command that just echoes what would run
mkdir -p ~/test-bin
cat > ~/test-bin/podman << 'EOF'
#!/bin/bash
echo "PODMAN COMMAND:"
echo "podman $@"
exit 0
EOF
chmod +x ~/test-bin/podman
# Add to PATH and test
export PATH="$HOME/test-bin:$PATH"
# Verify our mock is used
which podman
# Test various yolo invocations
echo "Testing: yolo"
./bin/yolo || true
echo "Testing: yolo -- \"help with code\""
./bin/yolo -- "help with code" || true
echo "Testing: yolo -v /data:/data --"
./bin/yolo -v /data:/data -- || true
integration-test:
name: Integration Test
runs-on: ubuntu-latest
needs: [shellcheck, test-setup]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install podman
run: |
sudo apt-get update
sudo apt-get install -y podman
- name: Run full setup (automated)
run: |
# Answer 'no' to installation prompt
echo "n" | ./setup-yolo.sh
- name: Verify container image
run: |
podman images
podman image exists con-bomination-claude-code
echo "✓ Container image successfully built"
- name: Test container can start
run: |
# Test that the container starts and can run a basic command
# We'll use --help which doesn't require authentication
podman run --rm con-bomination-claude-code claude --help
echo "✓ Container runs successfully"