-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (100 loc) · 3.13 KB
/
Copy pathci.yml
File metadata and controls
122 lines (100 loc) · 3.13 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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Run shellcheck on main script
run: shellcheck aicommit
- name: Run shellcheck on install script
run: shellcheck install.sh
- name: Run shellcheck on test helpers
run: |
if [ -d tests/helpers ]; then
shellcheck tests/helpers/*.bash || true
fi
integration-tests:
name: Integration Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y jq curl git
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install jq curl git
- name: Install BATS
run: |
git clone https://github.com/bats-core/bats-core.git /tmp/bats-core
cd /tmp/bats-core
sudo ./install.sh /usr/local
- name: Run tests
env:
OPENAI_API_KEY: test-key-for-ci
run: ./tests/run-tests.sh
install-validation:
name: Install Script Validation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y jq curl git
else
brew install jq curl git
fi
- name: Run install script
run: ./install.sh
- name: Verify installation
run: |
aicommit --help
# Test git integration (use -h instead of --help to avoid man page lookup)
git aicommit -h
changelog-validation:
name: CHANGELOG Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Validate CHANGELOG format
run: |
if [ ! -f CHANGELOG.md ]; then
echo "❌ CHANGELOG.md not found"
exit 1
fi
echo "Checking CHANGELOG.md format..."
if ! grep -q "# Changelog" CHANGELOG.md; then
echo "❌ Missing '# Changelog' header"
exit 1
fi
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
echo "❌ Missing '## [Unreleased]' section"
exit 1
fi
if ! grep -q "keepachangelog.com" CHANGELOG.md; then
echo "❌ Missing keepachangelog.com reference"
exit 1
fi
echo "✅ CHANGELOG.md is valid"