Skip to content

Commit d4319cc

Browse files
committed
CI: combine AWS-LC and AWS-LC-FIPS by template
let's reduce code duplication by involving workflow templates
1 parent c64781c commit d4319cc

3 files changed

Lines changed: 109 additions & 184 deletions

File tree

.github/workflows/aws-lc-fips.yml

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,8 @@ on:
55
- cron: "0 0 * * 4"
66
workflow_dispatch:
77

8-
permissions:
9-
contents: read
10-
118
jobs:
129
test:
13-
runs-on: ubuntu-latest
14-
if: ${{ github.repository_owner == 'haproxy' || github.event_name == 'workflow_dispatch' }}
15-
steps:
16-
- uses: actions/checkout@v4
17-
- name: Install VTest
18-
run: |
19-
scripts/build-vtest.sh
20-
- name: Determine latest AWS-LC release
21-
id: get_aws_lc_release
22-
run: |
23-
result=$(cd .github && python3 -c "from matrix import determine_latest_aws_lc_fips; print(determine_latest_aws_lc_fips(''))")
24-
echo $result
25-
echo "result=$result" >> $GITHUB_OUTPUT
26-
- name: Cache AWS-LC
27-
id: cache_aws_lc
28-
uses: actions/cache@v4
29-
with:
30-
path: '~/opt/'
31-
key: ssl-${{ steps.get_aws_lc_release.outputs.result }}-Ubuntu-latest-gcc
32-
- name: Install apt dependencies
33-
run: |
34-
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
35-
sudo apt-get --no-install-recommends -y install socat gdb jose
36-
- name: Install AWS-LC
37-
if: ${{ steps.cache_ssl.outputs.cache-hit != 'true' }}
38-
run: env ${{ steps.get_aws_lc_release.outputs.result }} scripts/build-ssl.sh
39-
- name: Compile HAProxy
40-
run: |
41-
make -j$(nproc) ERR=1 CC=gcc TARGET=linux-glibc \
42-
USE_OPENSSL_AWSLC=1 USE_QUIC=1 \
43-
SSL_LIB=${HOME}/opt/lib SSL_INC=${HOME}/opt/include \
44-
DEBUG="-DDEBUG_POOL_INTEGRITY -DDEBUG_UNIT" \
45-
ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
46-
sudo make install
47-
- name: Show HAProxy version
48-
id: show-version
49-
run: |
50-
ldd $(which haproxy)
51-
haproxy -vv
52-
echo "version=$(haproxy -v |awk 'NR==1{print $3}')" >> $GITHUB_OUTPUT
53-
- name: Install problem matcher for VTest
54-
run: echo "::add-matcher::.github/vtest.json"
55-
- name: Run VTest for HAProxy
56-
id: vtest
57-
run: |
58-
# This is required for macOS which does not actually allow to increase
59-
# the '-n' soft limit to the hard limit, thus failing to run.
60-
ulimit -n 65536
61-
# allow to catch coredumps
62-
ulimit -c unlimited
63-
make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
64-
- name: Run Unit tests
65-
id: unittests
66-
run: |
67-
make unit-tests
68-
- name: Show VTest results
69-
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
70-
run: |
71-
for folder in ${TMPDIR:-/tmp}/haregtests-*/vtc.*; do
72-
printf "::group::"
73-
cat $folder/INFO
74-
cat $folder/LOG
75-
echo "::endgroup::"
76-
done
77-
exit 1
78-
- name: Show coredumps
79-
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
80-
run: |
81-
failed=false
82-
shopt -s nullglob
83-
for file in /tmp/core.*; do
84-
failed=true
85-
printf "::group::"
86-
gdb -ex 'thread apply all bt full' ./haproxy $file
87-
echo "::endgroup::"
88-
done
89-
if [ "$failed" = true ]; then
90-
exit 1;
91-
fi
92-
- name: Show Unit-Tests results
93-
if: ${{ failure() && steps.unittests.outcome == 'failure' }}
94-
run: |
95-
for result in ${TMPDIR:-/tmp}/ha-unittests-*/results/res.*; do
96-
printf "::group::"
97-
cat $result
98-
echo "::endgroup::"
99-
done
100-
exit 1
101-
10+
uses: ./.github/workflows/aws-lc-template.yml
11+
with:
12+
command: "from matrix import determine_latest_aws_lc_fips; print(determine_latest_aws_lc_fips(''))"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: AWS-LC template
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
command:
7+
required: true
8+
type: string
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.repository_owner == 'haproxy' || github.event_name == 'workflow_dispatch' }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install VTest
20+
run: |
21+
scripts/build-vtest.sh
22+
- name: Determine latest AWS-LC release
23+
id: get_aws_lc_release
24+
run: |
25+
result=$(cd .github && python3 -c "${{ inputs.command }}")
26+
echo $result
27+
echo "result=$result" >> $GITHUB_OUTPUT
28+
- name: Cache AWS-LC
29+
id: cache_aws_lc
30+
uses: actions/cache@v4
31+
with:
32+
path: '~/opt/'
33+
key: ssl-${{ steps.get_aws_lc_release.outputs.result }}-Ubuntu-latest-gcc
34+
- name: Install apt dependencies
35+
run: |
36+
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
37+
sudo apt-get --no-install-recommends -y install socat gdb jose
38+
- name: Install AWS-LC
39+
if: ${{ steps.cache_ssl.outputs.cache-hit != 'true' }}
40+
run: env ${{ steps.get_aws_lc_release.outputs.result }} scripts/build-ssl.sh
41+
- name: Compile HAProxy
42+
run: |
43+
make -j$(nproc) ERR=1 CC=gcc TARGET=linux-glibc \
44+
USE_OPENSSL_AWSLC=1 USE_QUIC=1 \
45+
SSL_LIB=${HOME}/opt/lib SSL_INC=${HOME}/opt/include \
46+
DEBUG="-DDEBUG_POOL_INTEGRITY -DDEBUG_UNIT" \
47+
ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
48+
sudo make install
49+
- name: Show HAProxy version
50+
id: show-version
51+
run: |
52+
ldd $(which haproxy)
53+
haproxy -vv
54+
echo "version=$(haproxy -v |awk 'NR==1{print $3}')" >> $GITHUB_OUTPUT
55+
- name: Install problem matcher for VTest
56+
run: echo "::add-matcher::.github/vtest.json"
57+
- name: Run VTest for HAProxy
58+
id: vtest
59+
run: |
60+
# This is required for macOS which does not actually allow to increase
61+
# the '-n' soft limit to the hard limit, thus failing to run.
62+
ulimit -n 65536
63+
# allow to catch coredumps
64+
ulimit -c unlimited
65+
make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
66+
- name: Run Unit tests
67+
id: unittests
68+
run: |
69+
make unit-tests
70+
- name: Show VTest results
71+
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
72+
run: |
73+
for folder in ${TMPDIR:-/tmp}/haregtests-*/vtc.*; do
74+
printf "::group::"
75+
cat $folder/INFO
76+
cat $folder/LOG
77+
echo "::endgroup::"
78+
done
79+
exit 1
80+
- name: Show coredumps
81+
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
82+
run: |
83+
failed=false
84+
shopt -s nullglob
85+
for file in /tmp/core.*; do
86+
failed=true
87+
printf "::group::"
88+
gdb -ex 'thread apply all bt full' ./haproxy $file
89+
echo "::endgroup::"
90+
done
91+
if [ "$failed" = true ]; then
92+
exit 1;
93+
fi
94+
- name: Show Unit-Tests results
95+
if: ${{ failure() && steps.unittests.outcome == 'failure' }}
96+
run: |
97+
for result in ${TMPDIR:-/tmp}/ha-unittests-*/results/res.*; do
98+
printf "::group::"
99+
cat $result
100+
echo "::endgroup::"
101+
done
102+
exit 1
103+

.github/workflows/aws-lc.yml

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,8 @@ on:
55
- cron: "0 0 * * 4"
66
workflow_dispatch:
77

8-
permissions:
9-
contents: read
10-
118
jobs:
129
test:
13-
runs-on: ubuntu-latest
14-
if: ${{ github.repository_owner == 'haproxy' || github.event_name == 'workflow_dispatch' }}
15-
steps:
16-
- uses: actions/checkout@v4
17-
- name: Install VTest
18-
run: |
19-
scripts/build-vtest.sh
20-
- name: Determine latest AWS-LC release
21-
id: get_aws_lc_release
22-
run: |
23-
result=$(cd .github && python3 -c "from matrix import determine_latest_aws_lc; print(determine_latest_aws_lc(''))")
24-
echo $result
25-
echo "result=$result" >> $GITHUB_OUTPUT
26-
- name: Cache AWS-LC
27-
id: cache_aws_lc
28-
uses: actions/cache@v4
29-
with:
30-
path: '~/opt/'
31-
key: ssl-${{ steps.get_aws_lc_release.outputs.result }}-Ubuntu-latest-gcc
32-
- name: Install apt dependencies
33-
run: |
34-
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
35-
sudo apt-get --no-install-recommends -y install socat gdb jose
36-
- name: Install AWS-LC
37-
if: ${{ steps.cache_ssl.outputs.cache-hit != 'true' }}
38-
run: env ${{ steps.get_aws_lc_release.outputs.result }} scripts/build-ssl.sh
39-
- name: Compile HAProxy
40-
run: |
41-
make -j$(nproc) ERR=1 CC=gcc TARGET=linux-glibc \
42-
USE_OPENSSL_AWSLC=1 USE_QUIC=1 \
43-
SSL_LIB=${HOME}/opt/lib SSL_INC=${HOME}/opt/include \
44-
DEBUG="-DDEBUG_POOL_INTEGRITY -DDEBUG_UNIT" \
45-
ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
46-
sudo make install
47-
- name: Show HAProxy version
48-
id: show-version
49-
run: |
50-
ldd $(which haproxy)
51-
haproxy -vv
52-
echo "version=$(haproxy -v |awk 'NR==1{print $3}')" >> $GITHUB_OUTPUT
53-
- name: Install problem matcher for VTest
54-
run: echo "::add-matcher::.github/vtest.json"
55-
- name: Run VTest for HAProxy
56-
id: vtest
57-
run: |
58-
# This is required for macOS which does not actually allow to increase
59-
# the '-n' soft limit to the hard limit, thus failing to run.
60-
ulimit -n 65536
61-
# allow to catch coredumps
62-
ulimit -c unlimited
63-
make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
64-
- name: Run Unit tests
65-
id: unittests
66-
run: |
67-
make unit-tests
68-
- name: Show VTest results
69-
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
70-
run: |
71-
for folder in ${TMPDIR:-/tmp}/haregtests-*/vtc.*; do
72-
printf "::group::"
73-
cat $folder/INFO
74-
cat $folder/LOG
75-
echo "::endgroup::"
76-
done
77-
exit 1
78-
- name: Show coredumps
79-
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
80-
run: |
81-
failed=false
82-
shopt -s nullglob
83-
for file in /tmp/core.*; do
84-
failed=true
85-
printf "::group::"
86-
gdb -ex 'thread apply all bt full' ./haproxy $file
87-
echo "::endgroup::"
88-
done
89-
if [ "$failed" = true ]; then
90-
exit 1;
91-
fi
92-
- name: Show Unit-Tests results
93-
if: ${{ failure() && steps.unittests.outcome == 'failure' }}
94-
run: |
95-
for result in ${TMPDIR:-/tmp}/ha-unittests-*/results/res.*; do
96-
printf "::group::"
97-
cat $result
98-
echo "::endgroup::"
99-
done
100-
exit 1
101-
10+
uses: ./.github/workflows/aws-lc-template.yml
11+
with:
12+
command: "from matrix import determine_latest_aws_lc; print(determine_latest_aws_lc(''))"

0 commit comments

Comments
 (0)