Repository navigation
140 lines (129 loc) · 4.39 KB
/
Copy pathcommit_test.yml
File metadata and controls
140 lines (129 loc) · 4.39 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Linux4Delphi CI
on:
push:
branches: [ main, test** ]
pull_request:
branches: [ main, test** ]
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: './scripts'
severity: error
probe_urls:
name: Probe all hardcoded PAServer URLs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check every explicit PASERVER_URL is still reachable
run: |
set +e
fail=0
broken=()
while IFS= read -r url; do
status=$(curl -sI --max-time 15 "$url" 2>/dev/null | awk 'NR==1{print $2}' | tr -d '\r')
if [ "$status" = "200" ]; then
echo "OK ($status): $url"
else
echo "::error::Broken PASERVER_URL (status='$status'): $url"
broken+=("$url (status='$status')")
fail=1
fi
done < <(grep -oP 'PASERVER_URL="\Khttps?://[^"]+' scripts/SetupLinux4Delphi.sh)
if [ "$fail" -ne 0 ]; then
{
echo "### Broken PASERVER_URL(s)"
printf -- '- `%s`\n' "${broken[@]}"
} >> "$GITHUB_STEP_SUMMARY"
fi
exit "$fail"
plan:
name: Plan install tests
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.plan.outputs.versions }}
steps:
- uses: actions/checkout@v5
- name: Determine latest hardcoded version, probe for a newer guessed one
id: plan
run: |
set +e
latest=$(grep -oP 'PRODUCT="\K[0-9]+\.[0-9]+(\.[0-9]+)?' scripts/SetupLinux4Delphi.sh \
| sort -Vu | tail -1)
echo "Latest hardcoded version: $latest"
# Pull in just the guessing function; the full script requires root
# before it's even defined, and we don't want to install anything here.
source <(sed -n '/^try_guess_paserver_url()/,/^}/p' scripts/SetupLinux4Delphi.sh)
major="${latest%%.*}"
rest="${latest#*.}"
minor="${rest%%.*}"
candidates=("${major}.$((minor + 1))" "$((major + 1)).0")
guessed=""
for c in "${candidates[@]}"; do
if try_guess_paserver_url "$c"; then
echo "::warning::URL guessing found a newer, not-yet-listed PAServer version ($c -> $PASERVER_URL). Consider adding it to scripts/SetupLinux4Delphi.sh."
{
echo "### Newer version found by guessing"
echo "- **$c** -> \`$PASERVER_URL\`"
} >> "$GITHUB_STEP_SUMMARY"
guessed="$c"
break
fi
done
if [ -n "$guessed" ]; then
versions=$(printf '%s\n' "$latest" "$guessed" | jq -R . | jq -sc .)
else
versions=$(printf '%s\n' "$latest" | jq -R . | jq -sc .)
fi
echo "versions=$versions" >> "$GITHUB_OUTPUT"
echo "Testing versions: $versions"
ubuntu_test:
name: Ubuntu 26.04 (${{ matrix.version }})
needs: plan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.plan.outputs.versions) }}
steps:
- uses: actions/checkout@v5
- name: Run Setup and Verify PAServer in Ubuntu 26.04
run: |
docker run --rm --privileged \
-e DEBIAN_FRONTEND=noninteractive \
-v "$PWD:/workspace" \
ubuntu:26.04 \
bash -c "
set -e
chmod +x /workspace/scripts/SetupLinux4Delphi.sh
/workspace/scripts/SetupLinux4Delphi.sh ${{ matrix.version }}
/usr/local/bin/pa${{ matrix.version }}.sh &
sleep 15
pgrep paserver
"
rhel_test:
name: RHEL 10 (${{ matrix.version }})
needs: plan
runs-on: ubuntu-latest
container:
image: redhat/ubi10:latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.plan.outputs.versions) }}
steps:
- uses: actions/checkout@v5
- name: Run Setup
run: |
chmod +x ./scripts/SetupLinux4Delphi.sh
./scripts/SetupLinux4Delphi.sh ${{ matrix.version }}
- name: Verify PAServer
run: |
/usr/local/bin/pa${{ matrix.version }}.sh &
sleep 15
pgrep paserver