mirror of https://github.com/c-ares/c-ares.git
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
parent
5f0428637b
commit
d693951067
16 changed files with 292 additions and 66 deletions
@ -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 |
@ -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 |
@ -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 |
Loading…
Reference in new issue