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

Add basic workflows #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
73 changes: 73 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow to help you get started with Actions
name: Code coverage (All example)

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: "OS: ${{ matrix.os-version }} CXX: ${{ matrix.compiler }}"
runs-on: ${{ matrix.os-version }}

strategy:
fail-fast: false
matrix:
os-version: [ ubuntu-latest ]
compiler: [ gcc, clang ]
build_type: [ Debug ]

steps:
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}

- name: Install common dependencies -- gcc
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'gcc' }}
run: |
sudo apt update
sudo apt install lcov -y

- name: Install common dependencies -- clang
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'clang' }}
run: |
sudo apt update
sudo apt install llvm -y

- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@v1.1
with:
compiler: ${{ matrix.compiler }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v1
with:
submodules: recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9

- name: Coverage tests
shell: bash
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
run: |
cmake \
-S example/all \
-B build_ccov \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build_ccov --config ${{ matrix.build_type }}
cmake --build build_ccov --target help
cmake --build build_ccov --target ccov-all
73 changes: 73 additions & 0 deletions .github/workflows/coveragea-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow to help you get started with Actions
name: Code coverage ALL

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: "OS: ${{ matrix.os-version }} CXX: ${{ matrix.compiler }}"
runs-on: ${{ matrix.os-version }}

strategy:
fail-fast: false
matrix:
os-version: [ ubuntu-latest ]
compiler: [ gcc, clang ]
build_type: [ Debug ]

steps:
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}

- name: Install common dependencies -- gcc
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'gcc' }}
run: |
sudo apt update
sudo apt install lcov -y

- name: Install common dependencies -- clang
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'clang' }}
run: |
sudo apt update
sudo apt install llvm -y

- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@v1.1
with:
compiler: ${{ matrix.compiler }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v1
with:
submodules: recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9

- name: Coverage tests
shell: bash
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
run: |
cmake \
-S example/code-coverage-all \
-B build_ccov \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build_ccov --config ${{ matrix.build_type }}
cmake --build build_ccov --target help
cmake --build build_ccov --target ccov-all
73 changes: 73 additions & 0 deletions .github/workflows/coveragea-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow to help you get started with Actions
name: Code coverage PUBLIC

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: "OS: ${{ matrix.os-version }} CXX: ${{ matrix.compiler }}"
runs-on: ${{ matrix.os-version }}

strategy:
fail-fast: false
matrix:
os-version: [ ubuntu-latest ]
compiler: [ gcc, clang ]
build_type: [ Debug ]

steps:
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}

- name: Install common dependencies -- gcc
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'gcc' }}
run: |
sudo apt update
sudo apt install lcov -y

- name: Install common dependencies -- clang
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'clang' }}
run: |
sudo apt update
sudo apt install llvm -y

- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@v1.1
with:
compiler: ${{ matrix.compiler }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v1
with:
submodules: recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9

- name: Coverage tests
shell: bash
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
run: |
cmake \
-S example/code-coverage-public \
-B build_ccov \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build_ccov --config ${{ matrix.build_type }}
cmake --build build_ccov --target help
cmake --build build_ccov --target ccov-preprocessing
73 changes: 73 additions & 0 deletions .github/workflows/coveragea-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow to help you get started with Actions
name: Code coverage TARGET

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: "OS: ${{ matrix.os-version }} CXX: ${{ matrix.compiler }}"
runs-on: ${{ matrix.os-version }}

strategy:
fail-fast: false
matrix:
os-version: [ ubuntu-latest ]
compiler: [ gcc, clang ]
build_type: [ Debug ]

steps:
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}

- name: Install common dependencies -- gcc
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'gcc' }}
run: |
sudo apt update
sudo apt install lcov -y

- name: Install common dependencies -- clang
if: ${{ matrix.os-version == 'ubuntu-latest' && matrix.compiler == 'clang' }}
run: |
sudo apt update
sudo apt install llvm -y

- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@v1.1
with:
compiler: ${{ matrix.compiler }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v1
with:
submodules: recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9

- name: Coverage tests
shell: bash
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
run: |
cmake \
-S example/code-coverage-target \
-B build_ccov \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build_ccov --config ${{ matrix.build_type }}
cmake --build build_ccov --target help
cmake --build build_ccov --target ccov-main
61 changes: 61 additions & 0 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This is a basic workflow to help you get started with Actions
name: Sanitizers

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: "OS: ${{ matrix.os-version }} CXX: ${{ matrix.compiler }} SAN: ${{ matrix.sanitizer }}"
runs-on: ${{ matrix.os-version }}

strategy:
fail-fast: false
matrix:
os-version: [ ubuntu-latest ]
compiler: [ gcc, clang ]
build_type: [ Debug ]
sanitizer: [ Address, Memory, Leak, Thread, Undefined ]

steps:
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}

- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@v1.1
with:
compiler: ${{ matrix.compiler }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v1
with:
submodules: recursive

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9

- name: Test sanitizer
if: ${{ matrix.sanitizer != 'Memory' || matrix.sanitizer == 'Memory' && matrix.compiler == 'clang' }}
shell: bash
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}
run: |
cmake \
-S example/all \
-B build_sanitizer \
-DUSE_SANITIZER=${{ matrix.sanitizer }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build_sanitizer --config ${{ matrix.build_type }}
3 changes: 3 additions & 0 deletions example/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ include(dependency-graph)
# Require C++11
cxx_11()

# required by ALL
add_code_coverage_all_targets()

# Tools
file(GLOB_RECURSE FFILES *.[hc] *.[hc]pp)
clang_format(format ${FFILES})