update CI scripts

This commit is contained in:
BlackMATov
2022-06-30 19:18:28 +07:00
parent 8bb58778a0
commit ddc5413087
8 changed files with 114 additions and 120 deletions

View File

@@ -1,28 +0,0 @@
image:
- Visual Studio 2015
- Visual Studio 2017
platform:
- x86
- x64
configuration:
- Release
for:
-
matrix:
only:
- platform: x86
configuration: Release
build_script:
- .ci\build_windows_x86.bat
-
matrix:
only:
- platform: x64
configuration: Release
build_script:
- .ci\build_windows_x64.bat

16
.github/workflows/coverage.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: coverage
on: [push, pull_request]
jobs:
build:
runs-on: macos-11
name: "coverage"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install lcov by Homebrew
run: brew install lcov
- name: Build && Test && Upload
run: .ci/build_coverage.sh

24
.github/workflows/darwin.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: darwin
on: [push, pull_request]
jobs:
build:
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
# https://github.com/actions/virtual-environments/tree/main/images/macos
- { os: "macos-11", xcode: "13.0" }
- { os: "macos-11", xcode: "13.1" }
- { os: "macos-11", xcode: "13.2" }
name: "xcode-${{matrix.config.xcode}}"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
- name: Build && Test
run: .ci/build_darwin.sh

25
.github/workflows/linux.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: linux
on: [push, pull_request]
jobs:
build:
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
# https://github.com/actions/virtual-environments/tree/main/images/linux
- { os: "ubuntu-20.04", cc: "gcc-10", cxx: "g++-10" }
- { os: "ubuntu-20.04", cc: "clang-10", cxx: "clang++-10" }
name: "${{matrix.config.cxx}}"
steps:
- name: Setup
run: sudo apt-get -y install "${{matrix.config.cc}}" "${{matrix.config.cxx}}"
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build && Test
run: .ci/build_linux.sh
env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" }

21
.github/workflows/windows.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: windows
on: [push, pull_request]
jobs:
build:
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
# https://github.com/actions/virtual-environments/tree/main/images/win
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x86" }
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x64" }
name: "${{matrix.config.vs}} ${{matrix.config.arch}}"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build && Test
run: .ci\build_windows_${{matrix.config.arch}}.bat

View File

@@ -1,75 +0,0 @@
git:
depth: false
quiet: true
language: cpp
jobs:
include:
#
# linux (g++)
#
- os: linux
dist: xenial
stage: linux
name: g++-4.9
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-4.9"] } }
env: CC=gcc-4.9 CXX=g++-4.9
script: .ci/build_linux.sh
- os: linux
dist: xenial
stage: linux
name: g++-5
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-5"] } }
env: CC=gcc-5 CXX=g++-5
script: .ci/build_linux.sh
#
# linux (clang++)
#
- os: linux
dist: xenial
stage: linux
name: clang++-3.8
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-3.8"] } }
env: CC=clang-3.8 CXX=clang++-3.8
script: .ci/build_linux.sh
- os: linux
dist: xenial
stage: linux
name: clang++-4.0
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-4.0"] } }
env: CC=clang-4.0 CXX=clang++-4.0
script: .ci/build_linux.sh
#
# darwin
#
- os: osx
osx_image: xcode10
stage: darwin
name: xcode10
script: .ci/build_darwin.sh
- os: osx
osx_image: xcode11
stage: darwin
name: xcode11
script: .ci/build_darwin.sh
#
# coverage
#
- os: osx
osx_image: xcode10
stage: coverage
name: coverage
addons: { homebrew: { packages: ["lcov"], update: true } }
script: .ci/build_coverage.sh

View File

@@ -3,18 +3,29 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
if(NOT DEFINED PROJECT_NAME)
set(BUILD_AS_STANDALONE ON)
else()
set(BUILD_AS_STANDALONE OFF)
endif()
project(invoke.hpp)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11)
target_include_directories(${PROJECT_NAME} INTERFACE headers)
if(BUILD_AS_STANDALONE)
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
if(BUILD_WITH_UNTESTS)
enable_testing()
add_subdirectory(untests)
endif()
#
# BUILD_AS_STANDALONE
#
if(NOT ${BUILD_AS_STANDALONE})
return()
endif()
enable_testing()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
add_subdirectory(untests)

View File

@@ -2,26 +2,26 @@
> std::invoke/std::apply analogs for C++11/14
[![travis][badge.travis]][travis]
[![appveyor][badge.appveyor]][appveyor]
[![linux][badge.linux]][linux]
[![darwin][badge.darwin]][darwin]
[![windows][badge.windows]][windows]
[![codecov][badge.codecov]][codecov]
[![language][badge.language]][language]
[![license][badge.license]][license]
[![paypal][badge.paypal]][paypal]
[badge.travis]: https://img.shields.io/travis/BlackMATov/invoke.hpp/main.svg?logo=travis
[badge.appveyor]: https://img.shields.io/appveyor/ci/BlackMATov/invoke-hpp/main.svg?logo=appveyor
[badge.codecov]: https://img.shields.io/codecov/c/github/BlackMATov/invoke.hpp/main.svg?logo=codecov
[badge.darwin]: https://img.shields.io/github/workflow/status/BlackMATov/invoke.hpp/darwin/main?label=Xcode&logo=xcode
[badge.linux]: https://img.shields.io/github/workflow/status/BlackMATov/invoke.hpp/linux/main?label=GCC%2FClang&logo=linux
[badge.windows]: https://img.shields.io/github/workflow/status/BlackMATov/invoke.hpp/windows/main?label=Visual%20Studio&logo=visual-studio
[badge.codecov]: https://img.shields.io/codecov/c/github/BlackMATov/invoke.hpp/main?logo=codecov
[badge.language]: https://img.shields.io/badge/language-C%2B%2B11-red.svg
[badge.license]: https://img.shields.io/badge/license-MIT-blue.svg
[badge.paypal]: https://img.shields.io/badge/donate-PayPal-orange.svg?logo=paypal&colorA=00457C
[badge.license]: https://img.shields.io/badge/license-MIT-blue
[travis]: https://travis-ci.org/BlackMATov/invoke.hpp
[appveyor]: https://ci.appveyor.com/project/BlackMATov/invoke-hpp
[darwin]: https://github.com/BlackMATov/invoke.hpp/actions?query=workflow%3Adarwin
[linux]: https://github.com/BlackMATov/invoke.hpp/actions?query=workflow%3Alinux
[windows]: https://github.com/BlackMATov/invoke.hpp/actions?query=workflow%3Awindows
[codecov]: https://codecov.io/gh/BlackMATov/invoke.hpp
[language]: https://en.wikipedia.org/wiki/C%2B%2B11
[license]: https://en.wikipedia.org/wiki/MIT_License
[paypal]: https://www.paypal.me/matov
[invoke]: https://github.com/BlackMATov/invoke.hpp