Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: build with fedora 40 and add 2 build combinations back #2248

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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