From 408985bfdcacd4cf9925d89f31008c8b90a3ec9c Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Mon, 16 Sep 2024 14:53:48 -0400 Subject: [PATCH] ci: add clang CI builds --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ test/Makefile | 4 +-- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a971754..48d28f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,77 @@ jobs: cd test make + clang: + runs-on: ubuntu-${{ matrix.distro }} + strategy: + matrix: + include: + # Previous versions will no longer run on GitHub, but can be + # tested in Docker. Here are the versions which are available: + # + # - Ubuntu 14.04: 3.3 - 3.9 + # - Ubuntu 16.04: 3.5 - 6.0 + # - Ubuntu 18.04: 3.9 - 10 + + - version: "6.0" + distro: "20.04" + # - version: "7.0" + # distro: "20.04" + # - version: "8.0" + # distro: "20.04" + # - version: "9.0" + # distro: "20.04" + - version: "10" + distro: "20.04" + # - version: "6.0" + # distro: "20.04" + # - version: "7" + # distro: "20.04" + # - version: "8" + # distro: "20.04" + # - version: "9" + # distro: "20.04" + - version: "10" + distro: "20.04" + # - version: "11" + # distro: "20.04" + # - version: "12" + # distro: "20.04" + + # - version: "11" + # distro: "22.04" + # - version: "12" + # distro: "22.04" + # - version: "13" + # distro: "22.04" + - version: "14" + distro: "22.04" + # - version: "15" + # distro: "22.04" + + # - version: "14" + # distro: "24.04" + # - version: "15" + # distro: "24.04" + # - version: "16" + # distro: "24.04" + # - version: "17" + # distro: "24.04" + - version: "18" + distro: "24.04" + steps: + - uses: actions/checkout@v4 + - name: Install Clang ${{ matrix.version }} + run: | + sudo apt-get update + sudo apt-get -y install clang-${{ matrix.version }} + - name: Compile + env: + CC: clang-${{ matrix.version }} + CXX: clang++-${{ matrix.version }} + run: make + working-directory: test + dmc: runs-on: windows-latest strategy: diff --git a/test/Makefile b/test/Makefile index a35a5b7..c6cc863 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,7 +1,7 @@ CLANG_C_FLAGS = -Weverything -Wno-vla -Wno-covered-switch-default -Werror GCC_C_FLAGS = -Wall -Wextra -Werror -ifeq ($(notdir $(CC)), clang) +ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),clang)) CFLAGS ?= $(CLANG_C_FLAGS) else ifeq ($(notdir $(CC)), suncc) CFLAGS ?= -errwarn -errtags @@ -40,7 +40,7 @@ endif CLANG_CXX_FLAGS = -Weverything -Werror GCC_CXX_FLAGS = -Wall -Wextra -Werror -ifeq ($(notdir $(CXX)), clang++) +ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),clang++)) CXXFLAGS ?= $(CLANG_CXX_FLAGS) else ifeq ($(notdir $(CXX)), sunCC) CXXFLAGS ?= -errwarn=%all -errtags=yes