-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate-cli.yml
More file actions
65 lines (55 loc) · 1.65 KB
/
validate-cli.yml
File metadata and controls
65 lines (55 loc) · 1.65 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
name: Validate ConfigHub CLI Commands
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
validate-cli-commands:
runs-on: ubuntu-latest
name: Validate cub CLI Command Usage
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run cub Command Analyzer
run: |
chmod +x ./cub-command-analyzer.sh
./cub-command-analyzer.sh .
- name: Check for invalid commands
run: |
if ./cub-command-analyzer.sh . > /tmp/validation-output.txt 2>&1; then
echo "✅ All ConfigHub CLI commands are valid"
cat /tmp/validation-output.txt
exit 0
else
echo "❌ Found invalid ConfigHub CLI commands"
cat /tmp/validation-output.txt
exit 1
fi
- name: Upload validation results
if: always()
uses: actions/upload-artifact@v3
with:
name: cli-validation-results
path: /tmp/validation-output.txt
retention-days: 30
run-unit-tests:
runs-on: ubuntu-latest
name: Run CLI Validator Unit Tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run unit tests
run: |
chmod +x ./test/unit/test-cub-validator.sh
./test/unit/test-cub-validator.sh
- name: Check test results
run: |
if ./test/unit/test-cub-validator.sh | grep -q "Tests failed: 0"; then
echo "✅ All unit tests passed"
exit 0
else
echo "❌ Some unit tests failed"
exit 1
fi