diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..5ff4663 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml new file mode 100644 index 0000000..41d92bb --- /dev/null +++ b/.github/workflows/install.yml @@ -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 diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..55c5f3e --- /dev/null +++ b/.github/workflows/style.yml @@ -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 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000..3e66072 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..52941e8 --- /dev/null +++ b/.github/workflows/windows.yml @@ -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