Skip to content
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
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
58 changes: 51 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ jobs:
steps:
- name: Set up base image dependencies
run: |
yum -y update && \
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
wget unzip systemd-devel wget flex bison \
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \
postgresql-libs postgresql-devel postgresql-server postgresql && \
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm && \
yum -y update
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified and reduced dependencies required to speed up builds

yum install -y ca-certificates cmake gcc gcc-c++ make wget
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install -y cmake3
shell: bash

- uses: actions/checkout@v3

Expand All @@ -47,6 +45,24 @@ jobs:
cmake3 -DCFL_DEV=on .
make

build-debian:
name: Debian Buster build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: debian:buster
steps:
- name: Set up base image dependencies
run: |
apt-get update
apt-get install -y build-essential cmake make
shell: bash

- uses: actions/checkout@v3

- name: Run compilation
run: |
cmake -DCFL_DEV=on .
make
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this run in build/?
Could you use cmake --build . instead of make?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah can do, I just left it as it was before in the other builds.


build-unix-arm64:
name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -75,6 +91,7 @@ jobs:
CTEST_OUTPUT_ON_FAILURE=1 make test
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we use ctest for this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be fine, since cmake commands generate a Makefile test command that uses ctest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that doesn't work in windows right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Linux build

env:
CC: ${{ matrix.compiler }}

build-unix-amd64:
name: Build sources on amd64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
Expand All @@ -93,3 +110,30 @@ jobs:
CTEST_OUTPUT_ON_FAILURE=1 make test
env:
CC: ${{ matrix.compiler }}

build-analysis-tests:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from cmetrics/ctraces

name: Build with various code analysis tools
strategy:
fail-fast: false
matrix:
preset:
- clang-sanitize-address
- clang-sanitize-memory
- clang-sanitize-undefined
- clang-sanitize-dataflow
- clang-sanitize-safe-stack
- valgrind
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- uses: docker://lpenz/ghaction-cmake:0.19
with:
preset: ${{ matrix.preset }}
# dependencies_debian: ''
cmakeflags: '-DCFL_TESTS=On -DCFL_DEV=on .'
build_command: make all
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint PRs
on:
pull_request:
workflow_dispatch:

jobs:
shellcheck:
runs-on: ubuntu-latest
name: Shellcheck
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: ludeeus/action-shellcheck@master
with:
ignore_paths: lib
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scripts in xxhash have a few "issues" so ignoring any dependencies here.


actionlint:
runs-on: ubuntu-latest
name: Actionlint
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=
shell: bash

2 changes: 2 additions & 0 deletions .github/workflows/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ jobs:

- name: Unstable release on push to master to make it easier to download
uses: pyTooling/Actions/releaser@r0
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: 'unstable'
rm: true
files: |
artifacts/**/*

Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.12)
project(cfl C)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -123,6 +123,16 @@ if(NOT TARGET xxhash)
add_subdirectory(lib/xxhash/cmake_unofficial EXCLUDE_FROM_ALL)
endif()

# Installation Directories
# ========================
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CFL_INSTALL_BINDIR "bin")
set(CFL_INSTALL_LIBDIR "lib")
else()
set(CFL_INSTALL_BINDIR ${CMAKE_INSTALL_FULL_BINDIR})
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed what Fluent Bit did here but you may want another specific directory.

set(CFL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
endif()

# CFL sources
add_subdirectory(src)

Expand Down