-
Notifications
You must be signed in to change notification settings - Fork 21
106 lines (87 loc) · 2.91 KB
/
test.yml
File metadata and controls
106 lines (87 loc) · 2.91 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
name: Test Suite
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
jobs:
test:
name: Run All Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y sqlite3
- name: Install Node dependencies
run: npm ci
- name: Seed test databases
run: bash test/seed-test-dbs.sh
- name: Run all tests
run: bash test/run-all-tests.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-node-${{ matrix.node-version }}
path: |
/tmp/test-*.db
/tmp/example-*.db
retention-days: 7
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check bash script syntax
run: |
echo "Checking bash script syntax..."
find . -name "*.sh" -type f -exec bash -n {} \;
- name: Check for executable scripts
run: |
echo "Verifying executable permissions..."
# Check that all .sh files are executable
find tools/agents test -name "*.sh" -type f ! -executable -print | while read file; do
echo "Warning: $file is not executable"
done
structure:
name: Project Structure Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Verify project structure
run: |
echo "Verifying essential files exist..."
test -f README.md || (echo "Missing README.md" && exit 1)
test -f package.json || (echo "Missing package.json" && exit 1)
test -f install.sh || (echo "Missing install.sh" && exit 1)
test -d tools/agents || (echo "Missing tools/agents/ directory" && exit 1)
test -d lib || (echo "Missing lib/ directory" && exit 1)
test -d test || (echo "Missing test/ directory" && exit 1)
echo "✓ All essential files present"
- name: Verify tool scripts
run: |
echo "Verifying am-* tools exist..."
for tool in am-register am-agents am-whoami am-delete-agent; do
test -f "tools/agents/$tool" || (echo "Missing agents/$tool" && exit 1)
done
echo "✓ All Agent Registry tools present"
- name: Verify lib exports
run: |
echo "Verifying lib/ exports..."
test -f lib/tasks.js || (echo "Missing lib/tasks.js" && exit 1)
test -f lib/agent-mail.js || (echo "Missing lib/agent-mail.js" && exit 1)
echo "✓ All lib exports present"