-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.22 KB
/
Copy pathci.yml
File metadata and controls
50 lines (44 loc) · 1.22 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
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Verify shell scripts syntax
run: |
for f in hooks/* install.sh tests/*.sh; do
[ -f "$f" ] || continue
sh -n "$f" || { echo "syntax error in $f"; exit 1; }
done
- name: Run tests
run: sh tests/run_tests.sh
- name: Smoke test install.sh
run: |
TMP=$(mktemp -d)
cd "$TMP"
git init -q
git config user.email t@t.t
git config user.name t
git config commit.gpgsign false
sh "$GITHUB_WORKSPACE/install.sh"
test -x .git/hooks/pre-commit
test -x .git/hooks/commit-msg
test -x .git/hooks/pre-push
echo x > a.txt
git add a.txt
if git commit -m "bad" 2>/dev/null; then
echo "FAIL: bad commit should be rejected"
exit 1
fi
echo "PASS: install + commit-msg hook working"
cd /tmp
rm -rf "$TMP"