Skip to content

Commit

Permalink
swap circleci for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiman committed Oct 2, 2024
1 parent 2d69bf9 commit 741002c
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 95 deletions.
95 changes: 0 additions & 95 deletions .circleci/config.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Python format

on: [push, pull_request]

jobs:
python-format:
name: Enforce python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/[email protected]
with:
version: "24.8.0"
src: ./scripts
# override options so that we can specify only specific files for now
options: "--check --diff --include=.*addr2line.*"
114 changes: 114 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
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
enable-ccache:
description: 'build with ccache enabled'
type: boolean
default: true
required: false
options:
description: 'additional options passed to configure.py'
type: string
default: ''
required: false
crypto_provider:
description: 'cryptographic provider to use'
type: string
default: 'GnuTLS'
required: false

jobs:
test:
timeout-minutes: 40
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
if: ${{ inputs.enable-ccache }}
run: |
sudo dnf -y install ccache
- name: Setup ccache
if: ${{ inputs.enable-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
if ${{ inputs.enable-ccache }}; then
MAYBE_CCACHE_OPT="--ccache"
fi
./configure.py \
--c++-standard ${{ inputs.standard }} \
--compiler ${{ inputs.compiler }} \
--c-compiler $CC \
--mode ${{ inputs.mode }} \
$MAYBE_CCACHE_OPT \
${{ inputs.options }} \
${{ inputs.enables }} \
--crypto-provider ${{ inputs.crypto_provider }}
- name: Build
run: cmake --build build/${{inputs.mode}}

- name: Check Header
if: ${{ inputs.mode == 'dev' && inputs.compiler == 'clang++' }}
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 }}
64 changes: 64 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test

permissions:
contents: read

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
regular_test:
name: "Test (${{ matrix.compiler }}, C++${{ matrix.standard}}, ${{ matrix.mode }}, ${{ matrix.crypto_provider }})"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
matrix:
compiler: [clang++, g++]
standard: [20, 23]
mode: [dev, debug, release]
crypto_provider: [GnuTLS, OpenSSL]
with:
compiler: ${{ matrix.compiler }}
standard: ${{ matrix.standard }}
mode: ${{ matrix.mode }}
enables: ${{ matrix.enables }}
options: ${{ matrix.options }}
crypto_provider: ${{ matrix.crypto_provider }}
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
build_with_cxx_modules_gnutls:
name: "Test with C++20 modules enabled (GnuTLS)"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: debug
enables: --enable-cxx-modules
enable-ccache: false
crypto_provider: GnuTLS
build_with_cxx_modules_openssl:
name: "Test with C++20 modules enabled (OpenSSL)"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: debug
enables: --enable-cxx-modules
enable-ccache: false
crypto_provider: OpenSSL

0 comments on commit 741002c

Please sign in to comment.