CI: Move more to GitHub actions including Containers (#842)

GitHub actions supports running tests on various docker containers, move
Ubuntu 20.04 and Alpine tests to containers. Also move iOS testing to
GitHub actions since that runs on MacOS which is supported.

This should take additional load off of Cirrus-CI which consumes credits
like crazy. This leaves only FreeBSD and Linux ARM testing on Cirrus-CI.

Authored-By: Brad House (@bradh352)
pull/846/head
Brad House 4 months ago committed by GitHub
parent 5f0428637b
commit d693951067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 61
      .cirrus.yml
  2. 96
      .github/workflows/alpine-latest.yml
  3. 5
      .github/workflows/codespell.yml
  4. 6
      .github/workflows/coverity.yml
  5. 5
      .github/workflows/djgpp.yml
  6. 45
      .github/workflows/ios.yml
  7. 5
      .github/workflows/netbsd.yml
  8. 6
      .github/workflows/openbsd.yml
  9. 1
      .github/workflows/reuse.yml
  10. 4
      .github/workflows/solaris.yml
  11. 7
      .github/workflows/sonarcloud.yml
  12. 100
      .github/workflows/ubuntu-2004.yml
  13. 3
      .github/workflows/ubuntu-latest.yml
  14. 5
      .github/workflows/watcom.yml
  15. 5
      .github/workflows/watt32.yml
  16. 4
      test/ares-test-mock-et.cc

@ -8,28 +8,6 @@ env:
task: task:
matrix: matrix:
- name: "Alpine amd64"
env:
DIST: "ALPINE"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
BUILD_ASAN: "yes"
BUILD_UBSAN: "yes"
BUILD_VALGRIND: "yes"
BUILD_ANALYZE: "yes"
TEST_DEBUGGER: "gdb"
TEST_SYMBOL_VISIBILITY: "yes"
container:
image: alpine:latest
- name: "Ubuntu OLD amd64"
env:
DIST: "UBUNTU"
LC_ALL: "C"
MAKE: "make"
TEST_DEBUGGER: "gdb"
container:
image: ubuntu:20.04
- name: "Debian arm64" - name: "Debian arm64"
env: env:
DIST: "DEBIAN-ARM" DIST: "DEBIAN-ARM"
@ -58,16 +36,6 @@ task:
TEST_SYMBOL_VISIBILITY: "yes" TEST_SYMBOL_VISIBILITY: "yes"
freebsd_instance: freebsd_instance:
image_family: freebsd-14-1 image_family: freebsd-14-1
- name: "iOS"
env:
DIST: "iOS"
MAKE: "make"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.0 -DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64 -G Ninja"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
CFLAGS: "-arch armv7 -arch armv7s -arch arm64 -miphoneos-version-min=10.0"
CONFIG_OPTS: "--host=arm-apple-darwin10 --disable-tests"
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
matrix: matrix:
- name: "CMAKE" - name: "CMAKE"
env: env:
@ -118,23 +86,6 @@ task:
install_script: install_script:
- | - |
case "${DIST}" in case "${DIST}" in
ALPINE)
apk add bash cmake samurai gtest-dev autoconf autoconf-archive automake libtool pkgconf make
case "${BUILD_TYPE}" in
asan|lsan|ubsan)
apk add clang17 compiler-rt lldb
;;
analyze)
apk add clang17 clang17-analyzer compiler-rt lldb
;;
valgrind)
apk add gcc g++ valgrind
;;
*)
apk add gcc g++ gdb
;;
esac
;;
UBUNTU|DEBIAN*) UBUNTU|DEBIAN*)
export DEBIAN_FRONTEND=noninteractive && \ export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \ apt-get update && \
@ -167,18 +118,6 @@ task:
;; ;;
esac esac
;; ;;
MACOS|iOS)
brew update
brew install ninja cmake googletest
case "${BUILD_TYPE}" in
asan|ubsan|lsan|analyze)
brew install llvm autoconf automake libtool make ninja
;;
autotools)
brew install autoconf automake libtool make
;;
esac
;;
esac esac
script: script:

@ -0,0 +1,96 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: Alpine (latest)
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}-alpine-latest
cancel-in-progress: true
env:
TEST_FILTER: "--gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja"
MAKE: make
jobs:
build:
runs-on: ubuntu-latest
container:
image: alpine:latest
# Needed for TCP FastOpen
options: --privileged
name: "Alpine (latest)"
steps:
- name: Install packages
run: |
apk add bash cmake samurai gtest-dev autoconf autoconf-archive automake libtool pkgconf make clang17 clang17-analyzer compiler-rt lldb gcc g++ valgrind gdb sudo
- name: Checkout c-ares
uses: actions/checkout@v4
- name: "Make sure TCP FastOpen is enabled"
run: |
sudo sysctl -w net.ipv4.tcp_fastopen=3
- name: "CMake: build and test c-ares"
env:
BUILD_TYPE: CMAKE
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
TEST_DEBUGGER: gdb
run: |
./ci/build.sh
./ci/test.sh
- name: "Autotools: build and test c-ares"
env:
BUILD_TYPE: autotools
TEST_DEBUGGER: gdb
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: UBSAN: build and test c-ares"
env:
BUILD_TYPE: "ubsan"
CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
LDFLAGS: "-fsanitize=undefined"
TEST_DEBUGGER: "none"
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: ASAN: build and test c-ares"
env:
BUILD_TYPE: "asan"
CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=address"
CXXFLAGS: "-fsanitize=address"
LDFLAGS: "-fsanitize=address"
TEST_DEBUGGER: "none"
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: Static Analyzer: build c-ares"
env:
BUILD_TYPE: "analyze"
CC: "clang"
CXX: "clang++"
SCAN_WRAP: "scan-build -v --status-bugs"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
TEST_DEBUGGER: "lldb"
run: |
./ci/build.sh
./ci/test.sh
- name: "Valgrind: build and test c-ares (no TCP FastOpen)"
env:
BUILD_TYPE: "valgrind"
TEST_WRAP: "valgrind --leak-check=full"
TEST_FILTER: "--gtest_filter=-*Container*:*LiveSearchANY*:*LiveSearchTXT*"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
TEST_DEBUGGER: none
run: |
sudo sysctl -w net.ipv4.tcp_fastopen=0
./ci/build.sh
./ci/test.sh

@ -14,9 +14,14 @@ on:
- 'src/**' - 'src/**'
- 'include/**' - 'include/**'
concurrency:
group: ${{ github.ref }}-codespell
cancel-in-progress: true
jobs: jobs:
codespell: codespell:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Codespell
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

@ -7,9 +7,15 @@ on:
push: push:
branches: [ coverity_scan ] branches: [ coverity_scan ]
workflow_dispatch: workflow_dispatch:
concurrency:
group: ${{ github.ref }}-coverity
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Coverity
steps: steps:
- name: Checkout Source - name: Checkout Source
uses: actions/checkout@v4 uses: actions/checkout@v4

@ -5,9 +5,14 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-djgpp
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
name: DJGPP
steps: steps:
- name: Install GNU Make - name: Install GNU Make
run: | run: |

@ -0,0 +1,45 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: iOS
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}-ios
cancel-in-progress: true
env:
DIST: "iOS"
MAKE: "make"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=10.0 -DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64 -G Ninja"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
jobs:
build:
runs-on: macos-latest
name: "iOS"
steps:
- name: Install packages
run: brew install cmake googletest llvm autoconf automake libtool make ninja
- name: Checkout c-ares
uses: actions/checkout@v4
- name: "CMake: build and test c-ares"
env:
BUILD_TYPE: CMAKE
run: |
./ci/build.sh
- name: "Autotools: build and test c-ares"
env:
BUILD_TYPE: autotools
CFLAGS: "-arch armv7 -arch armv7s -arch arm64 -miphoneos-version-min=10.0"
CONFIG_OPTS: "--host=arm-apple-darwin10 --disable-tests"
run: |
./ci/build.sh
- name: "Cmake: Static Analyzer: build c-ares"
env:
BUILD_TYPE: "analyze"
CC: "clang"
SCAN_WRAP: "/opt/homebrew/opt/llvm/bin/scan-build-py -v --status-bugs"
run: |
./ci/build.sh

@ -6,9 +6,14 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-netbsd
cancel-in-progress: true
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: NetBSD
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

@ -5,12 +5,16 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-openbsd
cancel-in-progress: true
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: OpenBSD
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Test - name: Test
uses: cross-platform-actions/action@v0.24.0 uses: cross-platform-actions/action@v0.24.0
env: env:

@ -17,6 +17,7 @@ permissions: {}
jobs: jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: REUSE compliance
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: REUSE Compliance Check - name: REUSE Compliance Check

@ -6,6 +6,10 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-solaris
cancel-in-progress: true
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest

@ -7,12 +7,17 @@ on:
- main - main
# pull_request: # pull_request:
# types: [opened, synchronize, reopened] # types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.ref }}-sonarcloud
cancel-in-progress: true
jobs: jobs:
build: build:
name: Build and analyze
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
name: "SonarCloud: Build and analyze"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

@ -0,0 +1,100 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: Ubuntu 20.04
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}-ubuntu-2004
cancel-in-progress: true
env:
TEST_FILTER: "--gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja"
MAKE: make
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
# Needed for TCP FastOpen
options: --privileged
name: "Ubuntu 20.04"
steps:
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get dist-upgrade -y --assume-yes
apt-get install -y --assume-yes sudo curl wget cmake ninja-build autoconf automake libtool g++ libgmock-dev pkg-config clang clang-tools lldb gdb valgrind
- name: Checkout c-ares
uses: actions/checkout@v4
- name: "Make sure TCP FastOpen is enabled"
run: |
sudo sysctl -w net.ipv4.tcp_fastopen=3
- name: "CMake: build and test c-ares"
env:
BUILD_TYPE: CMAKE
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
TEST_DEBUGGER: gdb
run: |
./ci/build.sh
./ci/test.sh
- name: "Autotools: build and test c-ares"
env:
BUILD_TYPE: autotools
TEST_DEBUGGER: gdb
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: UBSAN: build and test c-ares"
env:
BUILD_TYPE: "ubsan"
CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
LDFLAGS: "-fsanitize=undefined"
TEST_DEBUGGER: "none"
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: ASAN: build and test c-ares"
env:
BUILD_TYPE: "asan"
CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=address"
CXXFLAGS: "-fsanitize=address"
LDFLAGS: "-fsanitize=address"
TEST_DEBUGGER: "none"
run: |
./ci/build.sh
./ci/test.sh
- name: "CMake: Static Analyzer: build c-ares"
env:
BUILD_TYPE: "analyze"
CC: "clang"
CXX: "clang++"
SCAN_WRAP: "scan-build -v --status-bugs"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
TEST_DEBUGGER: "lldb"
run: |
./ci/build.sh
./ci/test.sh
- name: "Valgrind: build and test c-ares (no TCP FastOpen)"
env:
BUILD_TYPE: "valgrind"
TEST_WRAP: "valgrind --leak-check=full"
TEST_FILTER: "--gtest_filter=-*Container*:*LiveSearchANY*:*LiveSearchTXT*"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
TEST_DEBUGGER: none
run: |
sudo sysctl -w net.ipv4.tcp_fastopen=0
./ci/build.sh
./ci/test.sh

@ -67,6 +67,7 @@ jobs:
env: env:
BUILD_TYPE: "ubsan" BUILD_TYPE: "ubsan"
CC: "clang" CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=undefined -fno-sanitize-recover" CFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover" CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
@ -79,6 +80,7 @@ jobs:
env: env:
BUILD_TYPE: "asan" BUILD_TYPE: "asan"
CC: "clang" CC: "clang"
CXX: "clang++"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
CFLAGS: "-fsanitize=address" CFLAGS: "-fsanitize=address"
CXXFLAGS: "-fsanitize=address" CXXFLAGS: "-fsanitize=address"
@ -91,6 +93,7 @@ jobs:
env: env:
BUILD_TYPE: "analyze" BUILD_TYPE: "analyze"
CC: "clang" CC: "clang"
CXX: "clang++"
SCAN_WRAP: "scan-build -v --status-bugs" SCAN_WRAP: "scan-build -v --status-bugs"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF" CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
TEST_DEBUGGER: "lldb" TEST_DEBUGGER: "lldb"

@ -5,9 +5,14 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-openwatcom
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
name: OpenWatcom
steps: steps:
- uses: open-watcom/setup-watcom@v0 - uses: open-watcom/setup-watcom@v0
- name: Checkout Source - name: Checkout Source

@ -5,9 +5,14 @@ on:
push: push:
pull_request: pull_request:
concurrency:
group: ${{ github.ref }}-watt32
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
name: WATT32
env: env:
WATT_ROOT: "${{ github.workspace }}\\watt-32" WATT_ROOT: "${{ github.workspace }}\\watt-32"
steps: steps:

@ -1421,10 +1421,8 @@ TEST_P(NoRotateMultiMockEventThreadTest, ServerNoResponseFailover) {
* system. Its possible we could set a realtime priority on a thread to * system. Its possible we could set a realtime priority on a thread to
* help with this, but for now, just increase the delay */ * help with this, but for now, just increase the delay */
# define SERVER_FAILOVER_RETRY_DELAY 750 # define SERVER_FAILOVER_RETRY_DELAY 750
#elif defined(_WIN32)
# define SERVER_FAILOVER_RETRY_DELAY 500
#else #else
# define SERVER_FAILOVER_RETRY_DELAY 250 # define SERVER_FAILOVER_RETRY_DELAY 500
#endif #endif
class ServerFailoverOptsMockEventThreadTest : public MockMultiServerEventThreadTest { class ServerFailoverOptsMockEventThreadTest : public MockMultiServerEventThreadTest {
public: public:

Loading…
Cancel
Save