Skip to content

Commit

Permalink
Re-org ci by platform
Browse files Browse the repository at this point in the history
* Also adds in matrix for LIBCORO_FEATURES_* on ubuntu and fedora.
* Opensuse has the matrix as well but its just ON for now.
* Move coverage to its own file.
* Re-organize the examples to use variables

Closes #227
Closes #157
  • Loading branch information
jbaldwin committed Jan 3, 2024
1 parent 4f3684b commit a2f9c5e
Show file tree
Hide file tree
Showing 16 changed files with 574 additions and 508 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: ci-coverage

on: [pull_request, workflow_dispatch]

jobs:
ci-coverage:
name: ci-coverage
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Dependencies
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
curl \
git \
ninja-build \
g++ \
libssl-dev \
lcov
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
mkdir Debug
cd Debug
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DLIBCORO_FEATURE_NETWORKING=ON \
-DLIBCORO_FEATURE_PLATFORM=ON \
-DLIBCORO_FEATURE_TLS=ON \
-DLIBCORO_CODE_COVERAGE=ON \
..
ninja
- name: Coverage
run: |
cd Debug
ctest -VV
gcov -o ./test/CMakeFiles/libcoro_test.dir/main.cpp.o ./test/libcoro_test
lcov --include "*/include/coro/*" --include "*/src/*" --exclude "test/*" -o libcoro_tests.lcov -c -d .
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
with:
file: Debug/libcoro_tests.lcov
format: lcov
53 changes: 53 additions & 0 deletions .github/workflows/ci-emscripten.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ci-emscripten

on: [pull_request, workflow_dispatch]

jobs:
ci-emscripten-3_1_45:
name: emscripten-3_1_45
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Dependencies
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
git \
ninja-build
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Must be done after checkout since it requires the directory structure to be in place.
- name: Install emsdk
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.45
./emsdk activate 3.1.45
- name: Build
run: |
cd emsdk
. ./emsdk_env.sh
cd ..
mkdir Release
cd Release
emcmake cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
..
ninja
- name: Test
run: |
cd emsdk
. ./emsdk_env.sh
cd ../Release
node --experimental-wasm-eh ./test/libcoro_test.js
48 changes: 48 additions & 0 deletions .github/workflows/ci-fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci-fedora

on: [pull_request, workflow_dispatch]

jobs:
ci-fedora-gplusplus:
name: fedora-${{ matrix.fedora_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora_version: [32, 33, 34, 35, 36, 37]
libcoro_feature_networking: [ {enabled: ON, tls: ON}]
libcoro_feature_platform: [ON]
container:
image: fedora:${{ matrix.fedora_version }}
steps:
- name: Install Dependencies
run: |
sudo dnf install -y \
cmake \
git \
ninja-build \
gcc-c++ \
openssl \
openssl-devel
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Release
run: |
mkdir Release
cd Release
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DLIBCORO_FEATURE_NETWORKING=${{ matrix.libcoro_feature_networking.enabled }} \
-DLIBCORO_FEATURE_TLS=${{ matrix.libcoro_feature_networking.tls }} \
-DLIBCORO_FEATURE_PLATFORM=${{ matrix.libcoro_feature_platform }} \
..
ninja
- name: Test
run: |
cd Release
ctest -VV
50 changes: 50 additions & 0 deletions .github/workflows/ci-opensuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci-opensuse

on: [pull_request, workflow_dispatch]

jobs:
build-opensuse-15:
name: opensuse-15-g++
runs-on: ubuntu-latest
strategy:
matrix:
gplusplus_version: [10]
libcoro_feature_networking: [ {enabled: ON, tls: ON} ]
libcoro_feature_platform: [ON]
container:
image: opensuse/leap:15.2
steps:
- name: zypper
run: |
zypper install -y \
cmake \
git \
ninja \
gcc${{ matrix.gplusplus_version }} \
gcc${{ matrix.gplusplus_version }}-c++ \
openssl \
openssl-devel
# Cannot run higher version of checkout, node isn't backwards compatible
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
mkdir Release
cd Release
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc-${{ matrix.gplusplus_version }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.gplusplus_version }} \
-DLIBCORO_FEATURE_NETWORKING=${{ matrix.libcoro_feature_networking.enabled }} \
-DLIBCORO_FEATURE_TLS=${{ matrix.libcoro_feature_networking.tls }} \
-DLIBCORO_FEATURE_PLATFORM=${{ matrix.libcoro_feature_platform }} \
..
ninja
- name: Test
run: |
cd Release
ctest -VV
153 changes: 153 additions & 0 deletions .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: ci-ubuntu

on: [pull_request, workflow_dispatch]

jobs:
ci-ubuntu-20-04-gplusplus:
name: ci-ubuntu-20.04-g++-${{ matrix.gplusplus_version }}-networking-${{ matrix.libcoro_feature_networking.enabled }}-tls-${{ matrix.libcoro_feature_networking.tls }}-platform-${{ matrix.libcoro_feature_platform }}
runs-on: ubuntu-latest
strategy:
matrix:
gplusplus_version: [10]
libcoro_feature_networking: [ {enabled: ON, tls: ON}, {enabled: ON, tls: OFF}, {enabled: OFF, tls: OFF} ]
libcoro_feature_platform: [ON, OFF]
container:
image: ubuntu:20.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Dependencies
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
git \
ninja-build \
g++-${{ matrix.gplusplus_version }} \
libssl-dev
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
mkdir Release
cd Release
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc-${{ matrix.gplusplus_version }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.gplusplus_version }} \
-DLIBCORO_FEATURE_NETWORKING=${{ matrix.libcoro_feature_networking.enabled }} \
-DLIBCORO_FEATURE_TLS=${{ matrix.libcoro_feature_networking.tls }} \
-DLIBCORO_FEATURE_PLATFORM=${{ matrix.libcoro_feature_platform }} \
..
ninja
- name: Test
run: |
cd Release
ctest -VV
ci-ubuntu-22-04-gplusplus:
name: ci-ubuntu-22.04-g++
runs-on: ubuntu-latest
strategy:
matrix:
gplusplus_version: [11, 12, 13]
libcoro_feature_networking: [ {enabled: ON, tls: ON}]
libcoro_feature_platform: [ON]
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Dependencies
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
git \
ninja-build \
g++-${{ matrix.gplusplus_version }} \
libssl-dev
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
mkdir Release
cd Release
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc-${{ matrix.gplusplus_version }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.gplusplus_version }} \
-DLIBCORO_FEATURE_NETWORKING=${{ matrix.libcoro_feature_networking.enabled }} \
-DLIBCORO_FEATURE_TLS=${{ matrix.libcoro_feature_networking.tls }} \
-DLIBCORO_FEATURE_PLATFORM=${{ matrix.libcoro_feature_platform }} \
..
ninja
- name: Test
run: |
cd Release
ctest -VV
ci-ubuntu-22-04-clang:
name: ci-ubuntu-22.04-clang
runs-on: ubuntu-latest
strategy:
matrix:
clang_version: [16, 17]
libcoro_feature_networking: [ {enabled: ON, tls: ON}]
libcoro_feature_platform: [ON]
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Dependencies
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
apt-get install -y \
wget \
cmake \
git \
ninja-build \
libssl-dev
- name: install-clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh ${{ matrix.clang_version }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
mkdir Release
cd Release
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang-${{ matrix.clang_version }} \
-DCMAKE_CXX_COMPILER=clang++-${{ matrix.clang_version }} \
-DLIBCORO_FEATURE_NETWORKING=${{ matrix.libcoro_feature_networking.enabled }} \
-DLIBCORO_FEATURE_TLS=${{ matrix.libcoro_feature_networking.tls }} \
-DLIBCORO_FEATURE_PLATFORM=${{ matrix.libcoro_feature_platform }} \
..
ninja
- name: Test
run: |
cd Release
ctest -VV
23 changes: 23 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci-windows

on: [pull_request, workflow_dispatch]

jobs:
ci-windows-2022:
name: windows-2022
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
mkdir Release
cd Release
cmake ..
cmake --build . --config Release
- name: Test
run: |
cd Release
ctest --build-config Release -VV
Loading

0 comments on commit a2f9c5e

Please sign in to comment.