Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into v0.24.21-hunter
Browse files Browse the repository at this point in the history
  • Loading branch information
mloccy committed Oct 20, 2024
2 parents d28d0ca + 3545220 commit 9cd2b22
Show file tree
Hide file tree
Showing 719 changed files with 2,541 additions and 1,360 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ assignees: ''
```cmake
# CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.5)
include("cmake/HunterGate.cmake")
HunterGate(
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

* I've checked this [Git style guide](https://0.readthedocs.io/en/latest/git.html). **[Yes|No]**
* I've checked this [CMake style guide](https://0.readthedocs.io/en/latest/cmake.html). **[Yes|No]**
* My change will work with CMake 3.2 (minimum requirement for Hunter). **[Yes|No]**
* My change will work with CMake 3.5 (minimum requirement for Hunter). **[Yes|No]**
* I will try to keep this pull request as small as possible and will try not to mix unrelated features. **[Yes|No]**

---
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
steps:

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

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

Expand Down
46 changes: 29 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: CI
on:
push:
paths: [ 'cmake/projects/**' ]
paths:
- 'cmake/projects/**'
- 'cmake/modules/**'
- 'cmake/schemes/**'
- 'cmake/templates/**'
- 'tests/**'
pull_request:
paths: [ 'cmake/projects/**' ]
paths:
- 'cmake/projects/**'
- 'cmake/modules/**'
- 'cmake/schemes/**'
- 'cmake/templates/**'
- 'tests/**'
workflow_dispatch:
inputs:
project:
Expand All @@ -20,7 +30,7 @@ jobs:
steps:

- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

- name: Manual dispatch, get project name from input
if: github.event_name == 'workflow_dispatch'
Expand All @@ -30,7 +40,7 @@ jobs:
- name: Get changed files and save them to ${HOME}/files.json
if: github.event_name != 'workflow_dispatch'
id: files
uses: lots0logs/gh-action-get-changed-files@2.1.4
uses: lots0logs/gh-action-get-changed-files@2.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -39,7 +49,7 @@ jobs:
run: |
MATRIX=`python .github/workflows/set_matrix.py`
if [ "${MATRIX}" ]; then
echo "::set-output name=matrix::${MATRIX}"
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
else
exit 1
fi
Expand All @@ -60,12 +70,12 @@ jobs:
steps:

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

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

Expand All @@ -77,22 +87,24 @@ jobs:
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: Build hunter_tests Unix
if: runner.os != 'Windows' && matrix.toolchain == 'hunter_tests'
env:
PROJECT_DIR: ${{ matrix.example }}
run: |
bash ${{ matrix.script }}
- name: Build on Unix
if: runner.os != 'Windows'
if: runner.os != 'Windows' && matrix.toolchain != 'hunter_tests'
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
bash ${{ matrix.script }}
- name: Build on Windows
if: runner.os == 'Windows'
if: runner.os == 'Windows' && matrix.toolchain != 'hunter_tests'
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
${{ matrix.script }}
Expand All @@ -104,7 +116,7 @@ jobs:
steps:

- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

- name: Get job status via GitHub API
uses: octokit/[email protected]
Expand All @@ -121,7 +133,7 @@ jobs:
python .github/workflows/set_status.py
- name: Deploy job status to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: job_data
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
:: 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
set MINGW_PATH=C:\mingw64\bin

:: MSYS2 location
set MSYS_PATH=C:\msys64\usr\bin
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci/build_hunter_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Set the correct Python PATH
export PATH="${HUNTER_PYTHON_LOCATION}:${PATH}"

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

# we want to exit on the first error, and we want the run commands to be shown
set -ex

# Run build
cmake -S "${PROJECT_DIR}" -B build_hunter_test -DHUNTER_ENABLED=ON -DHUNTER_STATUS_DEBUG=ON
cmake --build build_hunter_test
1 change: 0 additions & 1 deletion .github/workflows/ci/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{ "example": "foo", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "osx-10-15-make-cxx14", "os": "macos-10.15", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "osx-12-3-arch-universal2-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "ios-nocodesign-15-5-arm64-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
{ "example": "foo", "toolchain": "ninja-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci/matrix_hunter_tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
// { "example": "tests/simple", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
// { "example": "tests/issue/22", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
// { "example": "tests/issue/24/unit", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/issue/107", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
// { "example": "tests/issue/109/unit", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/autotools-merge-lipo", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_create_args_file", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_create_dependency_entry", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_create_deps_info", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
// download cache tests disabled because upstream file missing
//{ "example": "tests/hunter_download_cache_meta_file", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
//{ "example": "tests/hunter_download_cache_raw_file", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_generate_qt_info", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_get_package_deps", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_get_package_deps_recurse", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_pack_directory", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_register_dependency", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_setup_msvc", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_sleep_before_download", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_unpack_directory", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_init_not_found_counter", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
// disabled because of 'Unexpected empty string' and I don't want to debug that test
//{ "example": "tests/hunter_check_toolchain_definition", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" },
{ "example": "tests/hunter_standard_flag", "toolchain": "hunter_tests", "os": "ubuntu-22.04", "python": "3.8", "script": "build_hunter_tests.sh" }
]
17 changes: 16 additions & 1 deletion .github/workflows/set_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,24 @@ def json_from_file_ignore_comments(filePath):
sys.exit('Can\'t read changed files from files.json')

projects = set()
run_hunter_tests : bool = False

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 file.startswith("cmake/modules/"):
run_hunter_tests = True
if file.startswith("cmake/schemes/"):
run_hunter_tests = True
if file.startswith("cmake/templates/"):
run_hunter_tests = True
if file.startswith("tests/"):
run_hunter_tests = True

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

default_matrix = json_from_file_ignore_comments(dafault_dir + 'matrix.json')
Expand All @@ -54,6 +63,12 @@ def json_from_file_ignore_comments(filePath):

include += project_matrix

if run_hunter_tests:
hunter_tests_matrix = json_from_file_ignore_comments(dafault_dir + 'matrix_hunter_tests.json')
for leg in hunter_tests_matrix:
leg['script'] = dafault_dir + leg['script']
include += hunter_tests_matrix

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

0 comments on commit 9cd2b22

Please sign in to comment.