Skip to content

Commit

Permalink
ci: add GCC CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nemequ committed Sep 17, 2024
1 parent 408985b commit 94fd032
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,62 @@ jobs:
run: make -f Makefile.dmc
working-directory: test

gcc:
runs-on: ubuntu-${{ matrix.distro }}
strategy:
fail-fast: false
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: 4.4 - 4.8
# - Ubuntu 16.04: 4.6 - 5
# - Ubuntu 18.04: 5 - 8

- version: "7"
distro: "20.04"
# - version: "8"
# distro: "20.04"
# - version: "9"
# distro: "20.04"
# - version: "10"
# distro: "20.04"

# - version: "9"
# distro: "22.04"
# - version: "10"
# distro: "22.04"
# - version: "11"
# distro: "22.04"
# - version: "12"
# distro: "22.04"

- version: "9"
distro: "24.04"
- version: "10"
distro: "24.04"
- version: "11"
distro: "24.04"
- version: "12"
distro: "24.04"
- version: "13"
distro: "24.04"
- version: "14"
distro: "24.04"
steps:
- uses: actions/checkout@v4
- name: Install GCC
run: |
sudo apt-get update
sudo apt-get -y install gcc-${{ matrix.version }} g++-${{ matrix.version }}
- name: Compile
env:
CC: gcc-${{ matrix.version }}
CXX: g++-${{ matrix.version }}
run: make
working-directory: test

icc:
runs-on: ubuntu-20.04
strategy:
Expand Down
8 changes: 4 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else ifeq ($(notdir $(CC)), icc)
else ifeq ($(notdir $(CC)), tcc)
CFLAGS ?=
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), gcc)
else ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),gcc))
CFLAGS ?= $(GCC_C_FLAGS)
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), x86_64-w64-mingw32-gcc)
Expand Down Expand Up @@ -60,7 +60,7 @@ else ifeq ($(notdir $(CXX)), xlc++)
else ifeq ($(notdir $(CXX)), icpc)
CXXFLAGS ?= $(GCC_CXX_FLAGS)
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), g++)
else ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),g++))
CXXFLAGS ?= $(GCC_CXX_FLAGS)
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), x86_64-w64-mingw32-g++)
Expand Down Expand Up @@ -295,13 +295,13 @@ maintainer-clean: clean

.PHONY: clean all

ifeq ($(notdir $(CC)), gcc)
ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),gcc))
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_C_WARNINGS,$(tgt))))
else ifeq ($(notdir $(CC)), x86_64-w64-mingw32-gcc)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_C_WARNINGS,$(tgt))))
endif

ifeq ($(notdir $(CXX)), g++)
ifeq ($(notdir $(firstword $(subst -, ,$(notdir $(CC))))),$(filter $(firstword $(subst -, ,$(notdir $(CC)))),g++))
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_CXX_WARNINGS,$(tgt))))
else ifeq ($(notdir $(CXX)), x86_64-w64-mingw32-g++)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_CXX_WARNINGS,$(tgt))))
Expand Down
4 changes: 3 additions & 1 deletion test/unavailable.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "common.h"

#if HEDLEY_GCC_HAS_WARNING("-Wattribute-warning",9,0,0)
#if HEDLEY_HAS_WARNING("-Wattribute-warning")
# pragma clang diagnostic warning "-Wattribute-warning"
#elif HEDLEY_GCC_VERSION_CHECK(9,0,0)
# pragma GCC diagnostic warning "-Wattribute-warning"
#endif

HEDLEY_UNAVAILABLE(3.14)
Expand Down

0 comments on commit 94fd032

Please sign in to comment.