Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CI to test Ubuntu 18.04 in containers #371

Merged
merged 4 commits into from
Jun 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 47 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
config:
- {name: 'ubuntu-14.04 gcc-4.8', os: ubuntu-latest, container: 'ubuntu:14.04', cc: 'gcc-4.8', cxx: 'g++-4.8', tag: '4.8', toolchain: 'ppa:ubuntu-toolchain-r/test'}
- {name: 'ubuntu-14.04 gcc-4.9', os: ubuntu-latest, container: 'ubuntu:14.04', cc: 'gcc-4.9', cxx: 'g++-4.9', tag: '4.9', toolchain: 'ppa:ubuntu-toolchain-r/test'}
- {name: 'ubuntu-18.04 gcc-5', os: ubuntu-18.04, cc: 'gcc-5', cxx: 'g++-5', tag: '5'}
- {name: 'ubuntu-18.04 gcc-6', os: ubuntu-18.04, cc: 'gcc-6', cxx: 'g++-6', tag: '6'}
- {name: 'ubuntu-18.04 gcc-7', os: ubuntu-18.04, cc: 'gcc-7', cxx: 'g++-7', tag: '7'}
- {name: 'ubuntu-18.04 gcc-8', os: ubuntu-18.04, cc: 'gcc-8', cxx: 'g++-8', tag: '8'}
- {name: 'ubuntu-18.04 gcc-5', os: ubuntu-latest, container: 'ubuntu:18.04', cc: 'gcc-5', cxx: 'g++-5', tag: '5'}
- {name: 'ubuntu-18.04 gcc-6', os: ubuntu-latest, container: 'ubuntu:18.04', cc: 'gcc-6', cxx: 'g++-6', tag: '6'}
- {name: 'ubuntu-18.04 gcc-7', os: ubuntu-latest, container: 'ubuntu:18.04', cc: 'gcc-7', cxx: 'g++-7', tag: '7'}
- {name: 'ubuntu-18.04 gcc-8', os: ubuntu-latest, container: 'ubuntu:18.04', cc: 'gcc-8', cxx: 'g++-8', tag: '8'}
- {name: 'ubuntu-20.04 gcc-9', os: ubuntu-20.04, cc: 'gcc-9', cxx: 'g++-9', tag: '9'}
- {name: 'ubuntu-20.04 gcc-10', os: ubuntu-20.04, cc: 'gcc-10', cxx: 'g++-10', tag: '10'}
- {name: 'ubuntu-22.04 gcc-11', os: ubuntu-20.04, cc: 'gcc-11', cxx: 'g++-11', tag: '11'}
Expand All @@ -40,33 +40,39 @@ jobs:
run: |
case "${GHA_CONTAINER}" in
ubuntu*)
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y install tzdata sudo apt-transport-https make apt-file software-properties-common libssl-dev build-essential autotools-dev autoconf automake pkgconf
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y install tzdata sudo apt-transport-https make apt-file software-properties-common libssl-dev build-essential autotools-dev autoconf automake pkgconf iproute2
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get -o Acquire::Retries=3 update && apt-get -o Acquire::Retries=3 -y install git
;;
*)
;;
esac
- name: override DNS to fix IP address for hostname in some Docker containers
if: matrix.config.container == 'ubuntu:14.04'
if: matrix.config.container != ''
run: |
echo "==="
echo "Before: /etc/hosts"
cat /etc/hosts
echo "==="
echo "Removing localhost name from ::1 entry in /etc/hosts..."
sed 's/^::1\s\s*localhost\s\(.*\)/::1 \1/' /etc/hosts > /tmp/hosts.temp
cp /tmp/hosts.temp /etc/hosts
rm /tmp/hosts.temp
echo "After: /etc/hosts"
cat /etc/hosts
echo "==="
ip addr
echo "==="
echo "'hostname -i' shows '$(hostname -i)'"
echo "'hostname -I' shows '$(hostname -I)'"
echo "'hostname -s' shows '$(hostname -s)'"
echo "'hostname -f' shows '$(hostname -f)'"
case "${GHA_CONTAINER}" in
ubuntu*)
echo "==="
echo "Before: /etc/hosts"
cat /etc/hosts
echo "==="
echo "Removing localhost name from ::1 entry in /etc/hosts..."
sed 's/^::1\s\s*localhost\s\(.*\)/::1 \1/' /etc/hosts > /tmp/hosts.temp
cp /tmp/hosts.temp /etc/hosts
rm /tmp/hosts.temp
echo "After: /etc/hosts"
cat /etc/hosts
echo "==="
ip addr
echo "==="
echo "'hostname -i' shows '$(hostname -i)'"
echo "'hostname -I' shows '$(hostname -I)'"
echo "'hostname -s' shows '$(hostname -s)'"
echo "'hostname -f' shows '$(hostname -f)'"
;;
*)
;;
esac
- name: configure toolchain (optional)
if: matrix.config.toolchain != ''
run: |
Expand All @@ -79,17 +85,23 @@ jobs:
run: |
chown -R $(id -u):$(id -g) .
- name: tweak multi_client_test.cc for container usage
if: matrix.config.container == 'ubuntu:14.04'
if: matrix.config.container != ''
run: |
echo "==="
echo "Before multi_client_test.cc:"
grep push_port tests/libgearman-1.0/multi_client_test.cc
echo "Changing multi_client_test.cc..."
sed -i -e '0,/test->push_port.*libtest/ s/\(test.*push_port(\).*libtest.*\();\)/\1 19298 \2/' tests/libgearman-1.0/multi_client_test.cc
sed -i -e '0,/test->push_port.*libtest/ s/\(test.*push_port(\).*libtest.*\();\)/\1 19300 \2/' tests/libgearman-1.0/multi_client_test.cc
echo "After multi_client_test.cc:"
grep push_port tests/libgearman-1.0/multi_client_test.cc
echo "==="
case "${GHA_CONTAINER}" in
ubuntu*)
echo "==="
echo "Before multi_client_test.cc:"
grep push_port tests/libgearman-1.0/multi_client_test.cc
echo "Changing multi_client_test.cc..."
sed -i -e '0,/test->push_port.*libtest/ s/\(test.*push_port(\).*libtest.*\();\)/\1 19298 \2/' tests/libgearman-1.0/multi_client_test.cc
sed -i -e '0,/test->push_port.*libtest/ s/\(test.*push_port(\).*libtest.*\();\)/\1 19300 \2/' tests/libgearman-1.0/multi_client_test.cc
echo "After multi_client_test.cc:"
grep push_port tests/libgearman-1.0/multi_client_test.cc
echo "==="
;;
*)
;;
esac
- name: install dependencies
run: |
case "${GHA_CONFIG_NAME}" in
Expand All @@ -116,6 +128,7 @@ jobs:
echo "CXXFLAGS: $CXXFLAGS"
fi
./configure --enable-ssl
shell: bash
- name: make
run: |
if [[ "${CC}" == gcc* ]] && [ "${CCVERSION}" -ge 9 ]; then
Expand All @@ -124,6 +137,7 @@ jobs:
echo "CXXFLAGS: $CXXFLAGS"
fi
${CC} --version && make
shell: bash
- name: make test
run: ${CC} --version && make test
- name: check test-suite.log
Expand Down