From 78137695f7b344788203405d4629968e77a79082 Mon Sep 17 00:00:00 2001 From: Brad House Date: Wed, 24 Jul 2024 06:41:30 -0400 Subject: [PATCH] CI: Migrate latest linux testing from Cirrus-CI to GitHub Actions (#828) Cirrus CI compute credits run out too fast. Lets migrate more tasks to GitHub Actions. Fix By: Brad House (@bradh352) --- .cirrus.yml | 24 -------- .github/workflows/ubuntu.yml | 106 +++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ubuntu.yml diff --git a/.cirrus.yml b/.cirrus.yml index b5e295bb..dd946b1b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,20 +8,6 @@ env: task: matrix: - - name: "Debian amd64" - env: - DIST: "DEBIAN" - LC_ALL: "C" - SCAN_BUILD: "scan-build" - MAKE: "make" - BUILD_ASAN: "yes" - BUILD_UBSAN: "yes" - BUILD_VALGRIND: "yes" - BUILD_COVERAGE: "yes" - BUILD_ANALYZE: "yes" - TEST_SYMBOL_VISIBILITY: "yes" - container: - image: debian:latest - name: "Alpine amd64" env: DIST: "ALPINE" @@ -82,16 +68,6 @@ task: - name: "CMAKE" env: BUILD_TYPE: "cmake" - - name: "CMAKE no threads" - only_if: $DIST == 'DEBIAN' - env: - BUILD_TYPE: "cmake" - CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_THREADS=OFF -G Ninja" - - name: "CMAKE HIDE SYMBOLS" - only_if: $TEST_SYMBOL_VISIBILITY == 'yes' - env: - BUILD_TYPE: "cmake" - CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=OFF -DCARES_SYMBOL_HIDING=ON -G Ninja" - name: "AUTOTOOLS" env: BUILD_TYPE: "autotools" diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..a527b093 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,106 @@ +# Copyright (C) The c-ares project and its contributors +# SPDX-License-Identifier: MIT +name: Ubuntu (latest) +on: + push: + pull_request: + +concurrency: + group: ${{ github.ref }}-ubuntu-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 + name: "Ubuntu (latest)" + steps: + - name: Install packages + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: cmake ninja-build autoconf automake libtool g++ libgmock-dev pkg-config clang clang-tools lldb gdb valgrind + version: 1.0 + - name: Checkout c-ares + uses: actions/checkout@v4 + - 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 + ./ci/distcheck.sh + - name: "CMake: (no threads) build and test c-ares" + env: + BUILD_TYPE: CMAKE + CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_THREADS=OFF -G Ninja" + CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" + TEST_DEBUGGER: gdb + run: | + ./ci/build.sh + ./ci/test.sh + - name: "CMake: (hide symbols) build and test c-ares" + env: + BUILD_TYPE: CMAKE + CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=OFF -DCARES_SYMBOL_HIDING=ON -G Ninja" + CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" + TEST_DEBUGGER: gdb + run: | + ./ci/build.sh + ./ci/test.sh + - name: "CMake: UBSAN: build and test c-ares" + env: + BUILD_TYPE: "ubsan" + CC: "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" + 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: "Valgrind: build and test c-ares" + 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: | + ./ci/build.sh + ./ci/test.sh + - name: "CMake: Static Analyzer: build c-ares" + env: + BUILD_TYPE: "analyze" + CC: "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