Skip to content

Commit

Permalink
Updates to get CI running again (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored Feb 19, 2024
2 parents b4cf04f + 979fdaa commit 2955304
Show file tree
Hide file tree
Showing 7 changed files with 778 additions and 310 deletions.
94 changes: 65 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: OpenELP CI

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
push:
branches:
- devel
- main
- release/*
schedule:
- cron: 0 0 1 * *

jobs:
build_and_test:
Expand All @@ -28,27 +28,30 @@ jobs:
- os: windows-latest
test_target: RUN_TESTS
extra_flags: /WX
extra_compiler_flags: /experimental:external /external:anglebrackets /external:W0
extra_compiler_flags: >-
/experimental:external
/external:anglebrackets
/external:W0
steps:
- name: Cache PCRE2
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/build/pcre-prefix/src/pcre2-10.36.tar.gz
key: pcre2-10.36
path: ${{runner.workspace}}/build/pcre-prefix/src/pcre2-10.42.tar.gz
key: pcre2-10.42
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get snapshot ID
id: get-snap-id
shell: bash
run: echo "::set-output name=snap_id::git${{github.sha}}" | cut -c-38
run: echo "snap_id=git${{github.sha}}" | cut -c-19 >> $GITHUB_OUTPUT
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
run: mkdir -p build
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >
run: >-
cmake ${{github.workspace}}
-Werror=dev
-Werror=deprecated
Expand All @@ -67,18 +70,37 @@ jobs:
-DCMAKE_SHARED_LINKER_FLAGS="${{matrix.extra_flags}}"
-DCMAKE_STATIC_LINKER_FLAGS="${{matrix.extra_flags}}"
- name: Build PCRE2
run: cmake --build ${{runner.workspace}}/build --config ${{matrix.build_type}} -j2 -t pcre
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t pcre
- name: Build project
run: cmake --build ${{runner.workspace}}/build --config ${{matrix.build_type}} -j2
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
- name: Test project
run: cmake --build ${{runner.workspace}}/build --config ${{matrix.build_type}} -j2 -t ${{matrix.test_target}}
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t ${{matrix.test_target}}
if: ${{matrix.test_target}}
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Package project
run: cmake --build ${{runner.workspace}}/build --config ${{matrix.build_type}} -j2 -t package
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t package
- name: Upload package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OpenELP-${{runner.os}}
path: ${{runner.workspace}}/build/_CPack_Packages/${{runner.os}}/ZIP/OpenELP-${{runner.os}}/*
Expand All @@ -91,25 +113,26 @@ jobs:
run: sudo apt-get install libclang-cpp9 libclang1-9 -y
- name: Cache Doxygen
id: cache-doxygen
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/doxygen
key: doxygen-1.9.1
key: doxygen-1.9.7
- name: Download Doxygen
if: steps.cache-doxygen.outputs.cache-hit != 'true'
working-directory: ${{runner.workspace}}
run: |
wget -O - https://doxygen.nl/files/doxygen-1.9.1.linux.bin.tar.gz | tar -xz
mv doxygen-1.9.1 doxygen
wget -O - https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz | tar -xz
mv doxygen-1.9.7 doxygen
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
run: mkdir -p build && echo "WARN_AS_ERROR = FAIL_ON_WARNINGS" >> ${{github.workspace}}/doc/Doxyfile.in
run: |
mkdir -p ${{runner.workspace}}/build
echo "WARN_AS_ERROR = FAIL_ON_WARNINGS" >> doc/Doxyfile.in
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >
run: >-
cmake ${{github.workspace}}
-Werror=dev
-Werror=deprecated
Expand All @@ -122,9 +145,13 @@ jobs:
-DOPENELP_EXTRA_VERSION=${{steps.get-snap-id.outputs.snap_id}}
-DOPENELP_DOC_INTERNAL=ON
- name: Build documentation
run: cmake --build ${{runner.workspace}}/build -j2 -t doc
run: >-
cmake
--build ${{runner.workspace}}/build
-j2
-t doc
- name: Upload documentation
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OpenELP-HTML-Docs
path: ${{runner.workspace}}/build/doc/html/*
Expand All @@ -134,14 +161,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
run: mkdir -p build
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >
run: >-
cmake ${{github.workspace}}
-Wno-dev
-DCMAKE_BUILD_TYPE=Debug
Expand All @@ -151,9 +178,18 @@ jobs:
-DOPENELP_USE_OPENSSL:BOOL=OFF
-DCMAKE_C_FLAGS="--coverage"
- name: Build project
run: cmake --build ${{runner.workspace}}/build --config Debug -j2
run: >-
cmake
--build ${{runner.workspace}}/build
--config Debug
-j2
- name: Test project
run: cmake --build ${{runner.workspace}}/build --config Debug -j2 -t test
run: >-
cmake
--build ${{runner.workspace}}/build
--config Debug
-j2
-t test
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Upload coverage
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

steps:
- name: Cache PCRE2
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{runner.workspace}}\build\pcre-prefix\src\pcre2-10.36.tar.gz
key: pcre2-10.36
path: ${{runner.workspace}}\build\pcre-prefix\src\pcre2-10.42.tar.gz
key: pcre2-10.42
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Package project
run: cmake --build ${{runner.workspace}}\build --config Release -j2 -t package
- name: Upload package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OpenELP-win64
path: ${{runner.workspace}}\build\OpenELP-*-win64.exe
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.5)
project(openelp C)

cmake_minimum_required(VERSION 3.4)

#
# Installation directories
#
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OpenELP also has the ability to bind to multiple network interfaces which are
routed to unique external IP addresses, and therefore is capable of accepting
connections from multiple clients simultaneously.

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cottsay/openelp/OpenELP%20CI/main?event=push&logo=github)](https://github.com/cottsay/openelp/actions?query=workflow%3A%22OpenELP+CI%22+branch%3Amain+event%3Apush) [![AUR version](https://img.shields.io/aur/version/openelp?logo=arch%20linux&&logoColor=ffffff)](https://aur.archlinux.org/packages/openelp/) [![EPEL package](https://img.shields.io/fedora/v/openelp/epel8?label=epel&logo=red%20hat)](https://src.fedoraproject.org/rpms/openelp) [![Fedora package](https://img.shields.io/fedora/v/openelp?logo=fedora)](https://src.fedoraproject.org/rpms/openelp) [![Codecov](https://img.shields.io/codecov/c/github/cottsay/openelp/main?logo=codecov&logoColor=ffffff)](https://app.codecov.io/gh/cottsay/openelp/branch/main)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/cottsay/openelp/ci.yaml?branch=main&event=push&logo=github)](https://github.com/cottsay/openelp/actions/workflows/ci.yaml?query=branch%3Amain+event%3Apush) [![AUR version](https://img.shields.io/aur/version/openelp?logo=arch%20linux&&logoColor=ffffff)](https://aur.archlinux.org/packages/openelp/) [![EPEL package](https://img.shields.io/fedora/v/openelp/epel8?label=epel&logo=red%20hat)](https://src.fedoraproject.org/rpms/openelp) [![Fedora package](https://img.shields.io/fedora/v/openelp?logo=fedora)](https://src.fedoraproject.org/rpms/openelp) [![Codecov](https://img.shields.io/codecov/c/github/cottsay/openelp/main?logo=codecov&logoColor=ffffff)](https://app.codecov.io/gh/cottsay/openelp/branch/main)

Prerequisites
-------------
Expand All @@ -34,9 +34,9 @@ To create a Windows installer, you will also need to install
The only runtime dependency that OpenELP has is on the PCRE2 shared library,
unless PCRE2 was bundled into OpenELP.

To install these prerequisites on Fedora (23+) and CentOS/RHEL (6+ w/EPEL), run:
To install these prerequisites on Fedora and RHEL (w/EPEL), run:
```
sudo yum install cmake doxygen gcc pcre2-devel pkgconfig openssl-devel
sudo dnf install cmake doxygen gcc pcre2-devel pkgconfig openssl-devel
```

Compiling
Expand Down
16 changes: 11 additions & 5 deletions cmake/BundlePCRE.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include(ExternalProject)

set(PCRE_TARGET_VERSION "10.36")
cmake_policy(SET CMP0135 OLD)

set(PCRE_TARGET_VERSION "10.42")
set(PCRE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pcre2)
set(PCRE_C_FLAGS ${CMAKE_C_FLAGS})

Expand Down Expand Up @@ -34,17 +36,21 @@ set(PCRE_CMAKE_ARGS
)

ExternalProject_Add(pcre
URL "http://ftp.pcre.org/pub/pcre/pcre2-${PCRE_TARGET_VERSION}.tar.gz"
URL_HASH SHA256=b95ddb9414f91a967a887d69617059fb672b914f56fa3d613812c1ee8e8a1a37
URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${PCRE_TARGET_VERSION}/pcre2-${PCRE_TARGET_VERSION}.tar.gz"
URL_HASH SHA256=c33b418e3b936ee3153de2c61cc638e7e4fe3156022a5c77d0711bcbb9d64f1f
CMAKE_ARGS ${PCRE_CMAKE_ARGS}
)

ExternalProject_Get_Property(pcre
SOURCE_DIR
)

if(WIN32 AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(PCRE_POSTFIX "d")
if(WIN32)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(PCRE_POSTFIX "-staticd")
else()
set(PCRE_POSTFIX "-static")
endif()
endif()

set(OPENELP_PCRE_LICENSE_PATH "${SOURCE_DIR}/LICENCE")
Expand Down
3 changes: 2 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ find_package(Doxygen)
#

if(DOXYGEN_FOUND)
set(OPENELP_DOC_README "\"${OPENELP_DIR}/README.md\"")
set(OPENELP_DOC_SOURCES "\"${OPENELP_INCLUDE_DIR}/openelp/openelp.h\" \\
\"${OPENELP_DIR}/CONTRIBUTING.md\" \\
\"${OPENELP_DIR}/TODO.md\" \\
\"${OPENELP_DIR}/README.md\"")
${OPENELP_DOC_README}")

if(OPENELP_DOC_INTERNAL)
set(OPENELP_DOC_SOURCES "${OPENELP_DOC_SOURCES} \\
Expand Down
Loading

0 comments on commit 2955304

Please sign in to comment.