Skip to content

Commit

Permalink
Merge 'github: build with fedora 40 and add 2 build combinations back…
Browse files Browse the repository at this point in the history
…' from Kefu Chai

in order to address the infra issues caused by unreliable connection to llvm's apt repo, and to bring the two missing build combinations back, in this series, we switch from `setup-cpp` action to fedora 40, and extract the test job into a reusable workflow.

Closes #2248

* github.com:scylladb/seastar:
  github: use fedora:40 image for testing
  github: add 2 testing combinations back to the matrix
  github: extract test.yaml into a resusable workflow
  • Loading branch information
nyh committed May 21, 2024
2 parents d8a70b3 + 28b0555 commit 67a14f9
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 100 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Test

permissions:
contents: read

on:
workflow_call:
inputs:
compiler:
description: 'the C++ compiler to use'
type: string
required: true
standard:
description: 'the C++ standard to use'
type: number
required: true
mode:
description: 'build mode (debug, dev or release)'
type: string
required: true
enables:
description: 'the --enable-* option passed to configure.py'
type: string
default: ''
required: false
options:
description: 'additional options passed to configure.py'
type: string
default: ''
required: false

jobs:
test:
runs-on: ubuntu-latest
container: fedora:40
steps:
- name: Install Git
run: |
sudo dnf -y install git
- uses: actions/checkout@v4
with:
submodules: "${{ contains(inputs.enables, 'dpdk') }}"

- name: Install build dependencies
run: |
sudo ./install-dependencies.sh
- name: Install clang++
if: ${{ inputs.compiler == 'clang++' }}
run: |
sudo dnf -y install clang
- name: Install clang-scan-deps
if: ${{ contains(inputs.enables, 'cxx-modules') }}
run: |
sudo dnf -y install clang-tools-extra
- name: Install ccache
run: |
sudo dnf -y install ccache
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ inputs.compiler }}-${{ inputs.standard }}-${{ inputs.mode }}-${{ inputs.enables }}

- name: Configure
run: |
if [ ${{ inputs.compiler }} = "clang++" ]; then
CC=clang
else
CC=gcc
fi
./configure.py \
--ccache \
--c++-standard ${{ inputs.standard }} \
--compiler ${{ inputs.compiler }} \
--c-compiler $CC \
--mode ${{ inputs.mode }} \
${{ inputs.options }} \
${{ inputs.enables }}
- name: Build
run: cmake --build build/${{inputs.mode}}

- name: Check Header
if: ${{ inputs.mode == 'dev' && inputs.compiler == 'clang++-18' }}
run: cmake --build build/${{ inputs.mode }} --target checkheaders

- name: Build with C++20 modules
if: ${{ contains(inputs.enables, 'cxx-modules') }}
run: cmake --build build/${{ inputs.mode }} --target hello_cxx_module

- name: Test
if: ${{ ! contains(inputs.enables, 'cxx-modules') }}
run: ./test.py --mode=${{ inputs.mode }}
131 changes: 31 additions & 100 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,108 +10,39 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: "Tests (${{ matrix.compiler }}, C++${{ matrix.standard}}, ${{ matrix.mode }}, ${{ matrix.enables }})"
runs-on: ubuntu-latest
regular_test:
name: "Test (${{ matrix.compiler }}, C++${{ matrix.standard}}, ${{ matrix.mode }})"
uses: ./.github/workflows/test.yaml
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]
include:
- compiler: clang++-18
standard: 20
mode: dev
- compiler: clang++-18
standard: 20
mode: debug
- compiler: clang++-18
standard: 20
mode: release
- compiler: clang++-18
standard: 23
mode: dev
- compiler: clang++-18
standard: 23
mode: debug
- compiler: clang++-18
standard: 23
mode: release
- compiler: gcc-13
standard: 20
mode: dev
- compiler: gcc-13
standard: 20
mode: debug
- compiler: gcc-13
standard: 20
mode: release
- compiler: gcc-13
standard: 23
mode: dev
- compiler: gcc-13
standard: 23
mode: debug
- compiler: gcc-13
standard: 23
mode: release
- compiler: clang++-18
standard: 23
mode: release
options: --cook dpdk --dpdk-machine haswell
enables: --enable-dpdk
- compiler: clang++-18
standard: 23
mode: debug
enables: --enable-cxx-modules
steps:
- uses: actions/checkout@v4
with:
submodules: "${{ contains(matrix.enables, 'dpdk') }}"

- name: Install build dependencies
run: |
sudo ./install-dependencies.sh
- name: Install ${{ matrix.compiler }}
uses: aminya/setup-cpp@master
with:
compiler: ${{ matrix.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(matrix.enables, 'cxx-modules') }}"

- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.compiler }}-${{ matrix.standard }}-${{ matrix.mode }}-${{ matrix.enables }}

- name: Configure
run: >
./configure.py
--ccache
--c++-standard ${{ matrix.standard }}
--compiler $CXX
--c-compiler $CC
--mode ${{ matrix.mode }}
${{ matrix.options }}
${{ matrix.enables }} ;
- name: Build
run: cmake --build build/${{matrix.mode}}

- name: Check Header
if: ${{ matrix.mode == 'dev' && matrix.compiler == 'clang++-18' }}
run: cmake --build build/${{ matrix.mode }} --target checkheaders

- name: Build with C++20 modules
if: ${{ contains(matrix.enables, 'cxx-modules') }}
run: cmake --build build/${{ matrix.mode }} --target hello_cxx_module

- name: Test
if: ${{ ! contains(matrix.enables, 'cxx-modules') }}
run: ./test.py --mode=${{ matrix.mode }}
with:
compiler: ${{ matrix.compiler }}
standard: ${{ matrix.standard }}
mode: ${{ matrix.mode }}
enables: ${{ matrix.enables }}
options: ${{ matrix.options }}
build_with_dpdk:
name: "Test with DPDK enabled"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: release
enables: --enable-dpdk
options: --cook dpdk --dpdk-machine haswell
build_with_cxx_modules:
name: "Test with C++20 modules enabled"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: debug
enables: --enable-cxx-modules

0 comments on commit 67a14f9

Please sign in to comment.