From 88a89ef0559a61e9394b2783f761f9f69d43893b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 17 May 2024 11:41:29 +0800 Subject: [PATCH] github: use fedora:40 image for testing instead of using ubuntu:jammy and setup-cpp action for prepearing the building toolchain, use fedora:40 container for building and testing. after switching to the github workflow based CI, we've been seeing test failures due to networking issue: ``` Failed to install llvm via system package manager Error: Command failed with exit code 35: curl -LJO https://apt.llvm.org/llvm.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- 0:04:19 --:--:-- 0 curl: (35) OpenSSL SSL_connect: Broken pipe in connection to apt.llvm.org:443 ``` since fedora 40 comes with all the dependencies we need, let's build and test in a container with the fedora:40 image. with, hopefully the better CDN of the docker, and more reliable mirrors of fedora repositories, and the package retrievial machinary built into fedora's package management tools, we should have a more resilient CI. Signed-off-by: Kefu Chai --- .github/workflows/test.yaml | 26 +++++++++++++++----------- .github/workflows/tests.yaml | 7 +++---- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bf90f0696f1..b01bb36d2bd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,7 +7,6 @@ on: workflow_call: inputs: compiler: - # only the compilers supported by setup-cpp can be used description: 'the C++ compiler to use' type: string required: true @@ -33,6 +32,7 @@ on: jobs: test: runs-on: ubuntu-latest + container: fedora:40 steps: - uses: actions/checkout@v4 with: @@ -42,15 +42,14 @@ jobs: run: | sudo ./install-dependencies.sh - - name: Install ${{ inputs.compiler }} - uses: aminya/setup-cpp@master - with: - compiler: ${{ inputs.compiler }} - ccache: true - # ubuntu:latest comes with CMake 3.29, so we just need to install - # ninja. see - # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#tools - ninja: "${{ contains(inputs.enables, 'cxx-modules') }}" + - name: Install clang++ + if: ${{ inputs.compiler == 'clang++' }} + run: | + sudo dnf -y install clang + + - name: Install ccache + run: | + sudo dnf -y install ccache - name: Setup ccache uses: hendrikmuhs/ccache-action@v1 @@ -59,10 +58,15 @@ jobs: - name: Configure run: > + if [ ${{ inputs.compiler }} = "clang++" ]; then + CC=clang + else + CC=gcc + fi ; ./configure.py --ccache --c++-standard ${{ inputs.standard }} - --compiler $CXX + --compiler ${{ inputs.compiler }} --c-compiler $CC --mode ${{ inputs.mode }} ${{ inputs.options }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index aafba28a9d7..5debb533902 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,8 +16,7 @@ jobs: strategy: fail-fast: false matrix: - # only the compilers supported by setup-cpp - compiler: [clang++-18, gcc-13] + compiler: [clang++, g++] standard: [20, 23] mode: [dev, debug, release] with: @@ -32,7 +31,7 @@ jobs: strategy: fail-fast: false with: - compiler: clang++-18 + compiler: clang++ standard: 23 mode: release enables: --enable-dpdk @@ -43,7 +42,7 @@ jobs: strategy: fail-fast: false with: - compiler: clang++-18 + compiler: clang++ standard: 23 mode: debug enables: --enable-cxx-modules