From a11e01120733ed8e6fd31a9f8ab9866fe265dd2e Mon Sep 17 00:00:00 2001 From: fantasy-peak <1356346239@qq.com> Date: Fri, 11 Aug 2023 10:36:01 +0900 Subject: [PATCH] Add clang to ci --- .github/workflows/ubuntu-clang16.yaml | 42 +++++++++++++++++++ .../{ubuntu.yaml => ubuntu-gcc13.yaml} | 2 +- xmake.lua | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ubuntu-clang16.yaml rename .github/workflows/{ubuntu.yaml => ubuntu-gcc13.yaml} (99%) diff --git a/.github/workflows/ubuntu-clang16.yaml b/.github/workflows/ubuntu-clang16.yaml new file mode 100644 index 0000000..a9b819d --- /dev/null +++ b/.github/workflows/ubuntu-clang16.yaml @@ -0,0 +1,42 @@ +name: Linux-clang + +on: + push: + branches: [ "main", "dev" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-22.04] + + steps: + - name: Installation + run: | + sudo apt-get update + sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip gobjc clang-14 wget + clang-14 -v + export CXX=clang-14 + export CC=clang-14 + wget https://github.com/xmake-io/xmake/releases/download/v2.8.1/xmake-v2.8.1.xz.run + chmod 777 xmake-v2.8.1.xz.run > a.txt + ./xmake-v2.8.1.xz.run + export XMAKE_ROOT="y" + source ~/.xmake/profile + xmake --version + - name: checkout + uses: actions/checkout@v3 + - name: build + run: | + export XMAKE_ROOT="y" + source ~/.xmake/profile + clang-14 -v + export CXX=clang-14 + export CC=clang-14 + xmake build -y + xmake install -o . + ldd ./bin/cpp-freegpt-webui diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu-gcc13.yaml similarity index 99% rename from .github/workflows/ubuntu.yaml rename to .github/workflows/ubuntu-gcc13.yaml index 8e83913..847221b 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu-gcc13.yaml @@ -1,4 +1,4 @@ -name: Linux +name: Linux-gcc13 on: push: diff --git a/xmake.lua b/xmake.lua index 9ff91de..274450f 100644 --- a/xmake.lua +++ b/xmake.lua @@ -11,7 +11,7 @@ add_requires("boost", {configs = {iostreams = true}}) set_languages("c++23") set_policy("check.auto_ignore_flags", false) -add_cxflags("-O2 -Wall -Wextra -pedantic-errors -Wno-missing-field-initializers -Wno-ignored-qualifiers") +add_cxflags("-O2 -Wall -pedantic-errors -Wno-missing-field-initializers -Wno-ignored-qualifiers") add_includedirs("include") target("cpp-freegpt-webui")