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

Feature/add ci #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation

on:
push:
tags:
- "*"

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
name: Build and publish documentation
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Install dependencies
run: |
brew install doxygen
pip3 install jinja2 Pygments

- name: Build
run: |
cmake -S documentation -B build
cmake --build build --target GenerateDocs

- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doxygen/html
48 changes: 48 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Install

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: build and install library
run: |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
sudo cmake --build build --target install
rm -rf build

- name: configure
run: cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
35 changes: 35 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Style

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Install format dependencies
run: |
choco install llvm ninja -y
pip3 install cmake_format==0.6.11 pyyaml

- name: configure
run: cmake -G Ninja -S . -B build -DDP_GENETIC_BUILD_EXAMPLES=OFF -DDP_GENETIC_BUILD_BENCHMARKS=OFF

- name: check style
run: cmake --build build --target check-format
67 changes: 67 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Ubuntu

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 4

env:
CPP_STANDARD: 20

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: 14
platform: x64

- name: set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: configure gcc
run: cmake -S . -B build -DDP_GENETIC_BUILD_EXAMPLES=OFF -DDP_GENETIC_BUILD_BENCHMARKS=OFF -DCMAKE_BUILD_TYPE=Debug

- name: configure clang
run: cmake -S . -B build-clang -DDP_GENETIC_BUILD_EXAMPLE=OFF -DDP_GENETIC_BUILD_BENCHMARKS=OFF -DCMAKE_BUILD_TYPE=Debug
env:
CC: clang
CXX: clang++

- name: build
run: |
cmake --build build -j4
cmake --build build-clang -j4

- name: test
run: |
cd build
ctest --build-config Debug

- name: test clang
run: |
cd build-clang
ctest --build-config Debug
36 changes: 36 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Windows

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: configure
run: cmake -S . -B build -DDP_GENETIC_BUILD_EXAMPLES=OFF -DDP_GENETIC_BUILD_BENCHMARKS=OFF

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug