Skip to content
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
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--- If you have a trivial question you can ask it in Gitter room: https://gitter.im/ruslo/hunter -->
<!--- If you have a trivial question you can ask it in Gitter room: https://gitter.im/cpp-pm/hunter -->

* I've read [Brief overview section](https://hunter.readthedocs.io/en/latest/overview.html) and do understand basic concepts. **[Yes|No]**
* I've read [F.A.Q. section](https://hunter.readthedocs.io/en/latest/faq.html) and haven't found an answer to my question. **[Yes|No]**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

<!--- If you have a trivial question, you can ask it in Gitter room: https://gitter.im/ruslo/hunter -->
<!--- If you have a trivial question, you can ask it in Gitter room: https://gitter.im/cpp-pm/community -->

* I've read [Brief overview section](https://hunter.readthedocs.io/en/latest/overview.html) and do understand basic concepts. **[Yes|No]**
* I've read [F.A.Q. section](https://hunter.readthedocs.io/en/latest/faq.html) and haven't found an answer to my question. **[Yes|No]**
Expand Down
25 changes: 8 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
* I've followed [this guide](https://hunter.readthedocs.io/en/latest/creating-new/create/cmake.html)
step by step carefully. **[Yes|No]**

* I've tested this package remotely and have excluded all broken builds.
Here is the links to the Travis/AppVeyor with status "All passed":

* https://ci.appveyor.com/project/<username>/hunter/build/<build-number>
* https://travis-ci.org/<username>/hunter/builds/<build-number>

* I have submitted CI configs to https://github.com/cpp-pm/hunter-testing targeting `pkg.template` branch,
see this merged pull request https://github.com/cpp-pm/hunter-testing/pull/<number>

<!--- Remove next line if there is no corresponding "New package" issue. -->
* My change will resolve this "New package" request: https://github.com/cpp-pm/hunter/issues/<number>

Expand All @@ -25,15 +16,15 @@
* I've followed [this guide](https://hunter.readthedocs.io/en/latest/creating-new/update.html)
step by step carefully. **[Yes|No]**

* I've tested this package remotely and have excluded all broken builds.
Here is the links to the Travis/AppVeyor with status "All passed":

* https://ci.appveyor.com/project/<username>/hunter/build/<build-number>
* https://travis-ci.org/<username>/hunter/builds/<build-number>
<!--- Remove next line if this update doesn't break toolchains -->
* This update will break a few toolchains.
- Toolchain 1
- Toolchain 2

<!--- Remove next line if this update doesn't break old toolchains -->
* This update will break few old toolchains.
They are excluded in this pull request: https://github.com/cpp-pm/hunter-testing/pull/<number>
<!--- Remove next line if this update doesn't fix toolchains -->
* This update will fix a few toolchains.
- Toolchain 1
- Toolchain 2

---
<!--- END -->
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI-docs
on:
push:
branches: ['master', 'github_actions_ci']
paths: ['docs/**', 'examples/**']
pull_request:
branches: ['master', 'github_actions_ci']
paths: ['docs/**', 'examples/**']

jobs:

docs:
runs-on: ubuntu-latest

steps:

- name: Git checkout with submodules
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install virtualenv

- name: Run test script
run: |
cd docs
./jenkins.sh
134 changes: 134 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: CI
on:
push:
paths: [ 'cmake/projects/**' ]
pull_request:
paths: [ 'cmake/projects/**' ]
workflow_dispatch:
inputs:
project:
description: 'Project name'
required: true

jobs:

set_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:

- name: Git checkout
uses: actions/checkout@v2

- name: Manual dispatch, get project name from input
if: github.event_name == 'workflow_dispatch'
run: |
echo '["cmake/projects/${{ github.event.inputs.project }}/hunter.cmake"]' > ${HOME}/files.json

- name: Get changed files and save them to ${HOME}/files.json
if: github.event_name != 'workflow_dispatch'
id: files
uses: lots0logs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set matrix for subsequent build
id: set-matrix
run: |
MATRIX=`python .github/workflows/set_matrix.py`
if [ "${MATRIX}" ]; then
echo "::set-output name=matrix::${MATRIX}"
else
exit 1
fi

build:
name: ${{ matrix.example }} ${{ matrix.toolchain }} ${{ matrix.os }}
needs: set_matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.set_matrix.outputs.matrix) }}

env:
TOOLCHAIN: ${{ matrix.toolchain }}
PROJECT_DIR: examples/${{ matrix.example }}
GITHUB_USER_PASSWORD: ${{ secrets.CPP_PM_BOT_TOKEN }}

steps:

- name: Git checkout with submodules
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Set up Python environment variable (Unix)
if: runner.os != 'Windows'
run: echo "HUNTER_PYTHON_LOCATION=$pythonLocation" >> $GITHUB_ENV

- name: Set up Python environment variable (Windows)
if: runner.os == 'Windows'
run: echo "HUNTER_PYTHON_LOCATION=$env:pythonLocation" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
id: extract_branch

- name: Upgrade pip
run: |
python -m pip install --upgrade pip

- name: Build on Unix
if: runner.os != 'Windows'
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
run: |
bash ${{ matrix.script }}

- name: Build on Windows
if: runner.os == 'Windows'
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
run: |
${{ matrix.script }}

set_status:
needs: [ set_matrix, build ]
if: always() && needs.set_matrix.result == 'success' && github.event_name != 'pull_request'
runs-on: ubuntu-latest

steps:

- name: Git checkout
uses: actions/checkout@v2

- name: Get job status via GitHub API
uses: octokit/[email protected]
id: get_job_data
with:
route: GET /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Parse job status
run: |
mkdir job_data
echo '${{ steps.get_job_data.outputs.data }}' > job_data.json
python .github/workflows/set_status.py

- name: Deploy job status to GitHub Pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: job_data
destination_dir: _data/projects
keep_files: true
enable_jekyll: true
48 changes: 48 additions & 0 deletions .github/workflows/ci/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
:: Install Python package 'requests'
pip install requests gitpython

:: Install latest Polly toolchains and scripts
C:\msys64\usr\bin\wget.exe https://github.com/cpp-pm/polly/archive/master.zip
7z x master.zip
set POLLY_ROOT=%cd%\polly-master

:: Install dependencies (CMake, Ninja)
python %POLLY_ROOT%\bin\install-ci-dependencies.py

:: Tune locations
set PATH=%cd%\_ci\cmake\bin;%PATH%
set PATH=%cd%\_ci\ninja;%PATH%

:: Remove entry with sh.exe from PATH to fix error with MinGW toolchain
:: (For MinGW make to work correctly sh.exe must NOT be in your path)
:: * http://stackoverflow.com/a/3870338/2288008
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%

:: Save git.exe in HUNTER_GIT_EXECUTABLE for upload
:: * https://docs.hunter.sh/en/latest/reference/user-variables.html#hunter-git-executable
:: Variable will be used in CMake so it's okay to use Unix style '/'
set HUNTER_GIT_EXECUTABLE=C:/Program Files/Git/bin/git.exe

set MINGW_PATH=C:\ProgramData\chocolatey\bin

:: MSYS2 location
set MSYS_PATH=C:\msys64\usr\bin

:: Visual Studio 15 2017: Mimic behavior of older versions
set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools

:: Visual Studio 16 2019: Mimic behavior of older versions
set VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools

:: To fix "path too long" error
if not "%TOOLCHAIN:vs-=%"=="%TOOLCHAIN%" set HUNTER_BINARY_DIR=C:\__BIN

:: Add msbuild to PATH (for vs-14 toolchain, GitHub windows-2016 runner doesn't have VS 2015)
if "%TOOLCHAIN:~0,5%"=="vs-14" set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;%PATH%

if "%BRANCH_NAME%" == "master" (
python jenkins.py --upload
) else (
python jenkins.py
)
33 changes: 33 additions & 0 deletions .github/workflows/ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Install Python package 'requests'
pip install requests gitpython

# Install latest Polly toolchains and scripts
wget https://github.com/cpp-pm/polly/archive/master.zip
unzip master.zip
POLLY_ROOT="`pwd`/polly-master"
export PATH="${POLLY_ROOT}/bin:${PATH}"

# Install dependencies (CMake, Android NDK)
install-ci-dependencies.py --prune-archives

# Tune locations
export PATH="`pwd`/_ci/cmake/bin:${PATH}"

# Installed if toolchain is Android (otherwise directory doesn't exist)
export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e"
export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c"
export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c"
export ANDROID_NDK_r16b="`pwd`/_ci/android-ndk-r16b"
export ANDROID_NDK_r17="`pwd`/_ci/android-ndk-r17"

# Use Xcode 11.3.1 instead of default 11.6 (for ios-13-2 toolchain, no iOS 13.2 SDK in Xcode 11.6)
if [[ "$TOOLCHAIN" =~ "ios-nocodesign-13-2" ]]; then
export DEVELOPER_DIR="/Applications/Xcode_11.3.1.app/Contents/Developer"
fi

# Run build script
if [[ "$BRANCH_NAME" == "master" ]]; then
python jenkins.py --upload
else
python jenkins.py
fi
22 changes: 22 additions & 0 deletions .github/workflows/ci/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{ "example": "foo", "toolchain": "clang-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "gcc-7-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-18.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "android-ndk-r17-api-24-arm64-v8a-clang-libcxx14", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "analyze-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "osx-10-13-make-cxx14", "os": "macos-10.15", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "osx-10-13-cxx14", "os": "macos-10.15", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "osx-10-15-dep-10-10-cxx17", "os": "macos-10.15", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "ios-nocodesign-13-2-dep-9-3", "os": "macos-10.15", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "ninja-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "nmake-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "vs-14-2015-sdk-8-1", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "mingw-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
{ "example": "foo", "toolchain": "msys-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }
]
59 changes: 59 additions & 0 deletions .github/workflows/set_matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os
import sys
import json
import re

# simple helper to allow single-line-comments with `//` in json files
# https://stackoverflow.com/a/57814048
def json_from_file_ignore_comments(filePath):
contents = ""
with open(filePath, "r") as fh:
for line in fh:
cleanedLine = line.split("//", 1)[0]
if len(cleanedLine) > 0 and line.endswith("\n") and "\n" not in cleanedLine:
cleanedLine += "\n"
contents += cleanedLine
json_data = json.loads(contents)
return json_data

try:
with open(os.environ.get('HOME') + '/files.json') as json_files:
files = json.load(json_files)
except IOError:
sys.exit('Can\'t read changed files from files.json')

projects = set()

p = re.compile('cmake/projects/([^/]+)')
for file in files:
if p.match(file):
project = p.match(file).group(1)
if os.path.isdir('cmake/projects/' + project):
projects.add(project)

if projects:
dafault_dir = '.github/workflows/ci/'

default_matrix = json_from_file_ignore_comments(dafault_dir + 'matrix.json')

include = []
for project in projects:
project_dir = 'cmake/projects/' + project + '/ci/';

matrix_override = project_dir + 'matrix.json';
if os.path.isfile(matrix_override):
project_matrix = json_from_file_ignore_comments(matrix_override)
else:
project_matrix = [ dict(leg, example = project) for leg in default_matrix ]

for leg in project_matrix:
if (os.path.isfile(project_dir + leg['script'])):
leg['script'] = project_dir + leg['script']
else:
leg['script'] = dafault_dir + leg['script']

include += project_matrix

print(json.dumps({'include': include}))
else:
sys.exit('No projects found')
Loading