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 - mac OS X travis #15

Closed
Closed
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
56 changes: 43 additions & 13 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,63 @@
name: CI
name: C/C++ CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# 3 jobs in total
os: [ubuntu-latest, macOS-latest]
compiler: [{
"cc": "clang",
"cxx": "clang++"
}]
exclude:
- os: macOS-latest
compiler:
cc: gcc
steps:
- uses: actions/checkout@v1
- name: prepare
- uses: actions/checkout@v2
name: checkout
with:
clean: true
fetch-depth: 1
- name: install dependencies
run: |
set -e
if [ "$RUNNER_OS" = "macOS" ]; then
brew install ninja
else
sudo apt-get update || true
sudo apt-get install -y ninja-build
fi
sudo python3 -m pip install --upgrade pip
sudo pip3 install scikit-build cmake requests gitpython gcovr pyyaml
- name: cmake
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # has to be included to access other secrets
GITHUB_HUNTER_USERNAME: ${{ secrets.GITHUB_HUNTER_USERNAME }}
GITHUB_HUNTER_TOKEN: ${{ secrets.GITHUB_HUNTER_TOKEN }}
run: |
mkdir -p build
mkdir build
cd build
cmake ..
make update -j
cmake .. -GNinja
- name: build
run: |
cd build
make -j
make install
ninja -j2 all
- name: check
run: |
cd build
make check -j
ninja check -j2
- name: package
run: |
cd build
make package
ninja package
rm -rf out/_CPack_Packages
- name: archive results
uses: actions/upload-artifact@v1
Expand Down
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ language: cpp

matrix:
include:
- compiler: gcc
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env: COMPILER=g++-7
- compiler: gcc
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env: COMPILER=g++-6
- compiler: clang
- os: linux
compiler: clang
addons:
apt:
sources:
Expand All @@ -30,7 +33,8 @@ matrix:
packages:
- clang-3.6
env: COMPILER=clang++-3.6
- compiler: clang
- os: linux
compiler: clang
addons:
apt:
sources:
Expand All @@ -39,9 +43,15 @@ matrix:
packages:
- clang-3.7
env: COMPILER=clang++-3.7
- os: osx
compiler: clang++
osx_image: xcode7.3
- os: osx
compiler: clang++
osx_image: xcode8

before_install:
- sudo apt-get update -qq
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi

# Build steps
script:
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cleanCppProject

![Build Status](https://travis-ci.org/kracejic/cleanCppProject.svg?branch=master)
![Github C/C++ Ubuntu/Mac OS X Build](https://github.com/kracejic/cleanCppProject/workflows/C%2FC%2B%2B%20CI/badge.svg)
![Travis C/C++ Ubuntu/Mac OS X Build](https://travis-ci.org/kracejic/cleanCppProject.svg?branch=master)

This is an empty frame for project in C++. It should help to start a new project without caring much about project/build environment setup.

Expand Down