mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-22 04:07:49 -05:00
Build examples in CI using GitHub (#283)
* build examples in CI using github * update cxxopts style
This commit is contained in:
30
.github/workflows/examples.yml
vendored
Normal file
30
.github/workflows/examples.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Examples
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gcc:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: build all
|
||||||
|
env:
|
||||||
|
CC: gcc
|
||||||
|
CXX: g++
|
||||||
|
run: python3 examples/build_all.py
|
||||||
|
|
||||||
|
clang:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: build all
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
run: python3 examples/build_all.py
|
||||||
49
.travis.yml
49
.travis.yml
@@ -1,49 +0,0 @@
|
|||||||
language: cpp
|
|
||||||
sudo: require
|
|
||||||
dist: xenial
|
|
||||||
|
|
||||||
common_sources: &all_sources
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty
|
|
||||||
|
|
||||||
python:
|
|
||||||
- 3.7
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
addons: &gcc8
|
|
||||||
apt:
|
|
||||||
sources: *all_sources
|
|
||||||
packages:
|
|
||||||
- g++-8
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="export CC=gcc-8; export CXX=g++-8;"
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources: *all_sources
|
|
||||||
packages:
|
|
||||||
- g++-8
|
|
||||||
- clang-6.0
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="export CC=clang-6.0; export CXX=clang++-6.0;"
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
# Update compilers
|
|
||||||
- eval "${MATRIX_EVAL}"
|
|
||||||
- echo "CC=$CC CXX=$CXX"
|
|
||||||
- wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v3.20.3/cmake-3.20.3-linux-x86_64.sh
|
|
||||||
- sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local
|
|
||||||
- export PATH=/usr/local/bin:$PATH
|
|
||||||
- cmake --version
|
|
||||||
|
|
||||||
script:
|
|
||||||
# unit tests
|
|
||||||
- cmake -Htest -Bbuild/test
|
|
||||||
- cmake --build build/test --target test-verbose
|
|
||||||
# build examples
|
|
||||||
- python3 examples/build_all.py
|
|
||||||
@@ -3,8 +3,14 @@
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
cxxopts::Options options("MyProgram", "One line description of MyProgram");
|
cxxopts::Options options("MyProgram", "One line description of MyProgram");
|
||||||
options.add_options()("h,help", "Show help")(
|
|
||||||
"d,debug", "Enable debugging")("f,file", "File name", cxxopts::value<std::string>());
|
// clang-format off
|
||||||
|
options.add_options()
|
||||||
|
("h,help", "Show help")
|
||||||
|
("d,debug", "Enable debugging")
|
||||||
|
("f,file", "File name", cxxopts::value<std::string>()
|
||||||
|
);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
auto result = options.parse(argc, argv);
|
auto result = options.parse(argc, argv);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user