Skip to content

Commit

Permalink
github: use fedora:40 image for testing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed May 17, 2024
1 parent 0f56770 commit 88a89ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +32,7 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container: fedora:40
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -32,7 +31,7 @@ jobs:
strategy:
fail-fast: false
with:
compiler: clang++-18
compiler: clang++
standard: 23
mode: release
enables: --enable-dpdk
Expand All @@ -43,7 +42,7 @@ jobs:
strategy:
fail-fast: false
with:
compiler: clang++-18
compiler: clang++
standard: 23
mode: debug
enables: --enable-cxx-modules

0 comments on commit 88a89ef

Please sign in to comment.