-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (86 loc) · 2.74 KB
/
Copy pathci.yml
File metadata and controls
106 lines (86 loc) · 2.74 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: CI
on:
push:
branches: ['**']
pull_request:
workflow_dispatch:
jobs:
shell-lint:
name: Bash & ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bash syntax check
run: bash -n install.sh
- name: Install ShellCheck
run: |
sudo apt-get update -qq
sudo apt-get install -y -q shellcheck
- name: ShellCheck (errors only)
run: shellcheck -S error install.sh
- name: ShellCheck (full report, non-blocking)
run: shellcheck install.sh || true
php-lint:
name: Embedded PHP lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: none
coverage: none
- name: Extract embedded PHP files
run: bash tests/extract-php.sh
- name: php -l on every extracted file
run: |
set -e
for f in tests/_extracted/*.php; do
echo "::group::Linting $f"
php -l "$f"
echo "::endgroup::"
done
bats-tests:
name: Bash unit tests (bats)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install bats
run: |
sudo apt-get update -qq
sudo apt-get install -y -q bats
- name: Run bats
run: bats --tap tests/install.bats
php-validators:
name: PHP validator unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
- name: Run validator tests
run: php tests/test-validators.php
caddyfile-validation:
name: Validate Caddyfile syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Caddy
run: |
sudo apt-get update -qq
sudo apt-get install -y -q debian-keyring debian-archive-keyring apt-transport-https curl gnupg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \
| sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' \
| sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt-get update -qq
sudo apt-get install -y -q caddy
- name: Prepare log directory (caddy validate öffnet Log-Files real)
run: |
sudo mkdir -p /var/log/caddy
sudo chmod 1777 /var/log/caddy
- name: Validate sample Caddyfile (representative shape)
run: caddy validate --config tests/sample-caddyfile --adapter caddyfile