Skip to content

Commit

Permalink
test for run-vcpkg@dev/vcpkgconfjson-support
Browse files Browse the repository at this point in the history
  • Loading branch information
lukka committed Dec 28, 2023
1 parent 274211b commit 3a5ce7c
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hosted-cmake-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
shell: bash

- name: Setup vcpkg for building artifacts
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgJsonGlob: '**/cmakepresets/vcpkg.json'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hosted-contexts-dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: [push, workflow_dispatch]
jobs:
job:
env:
vcpkgGitCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
if: contains( runner.os, 'windows')
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgDirectory: ${{ github.workspace }}/../b/vcpkg
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/hosted-dump-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'

steps:
- uses: actions/checkout@v3
Expand All @@ -30,7 +30,7 @@ jobs:
run: find $RUNNER_WORKSPACE
shell: bash
- name: Run vcpkg and dump its failure log
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
Expand All @@ -47,13 +47,13 @@ jobs:
include:
- os: windows-latest
triplet: x64-windows
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
triplet: x64-linux
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
triplet: x64-osx
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
env:
VCPKG_URL: https://github.com/microsoft/vcpkg.git/

Expand All @@ -67,7 +67,7 @@ jobs:
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup vpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/hosted-get-cmake-local-cache-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hosted-msbuild-vcpkg_submod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgJsonGlob: '**/cmakepresets/vcpkg.json'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hosted-ninja-toolchain-vcpkg_submod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgJsonGlob: '**/cmakepresets/vcpkg.json'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/hosted-ninja-vcpkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'

steps:
- uses: actions/checkout@v3
Expand All @@ -52,7 +52,7 @@ jobs:
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/hosted-ninja-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
vcpkgCommitId: 'c9f906558f9bb12ee9811d6edc98ec9255c6cda5'
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'

steps:
- uses: actions/checkout@v3
Expand All @@ -45,7 +45,7 @@ jobs:
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hosted-ninja-vcpkg_submod-autocache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
shell: bash

- name: Restore vcpkg executable and data files from GH Action cache, or setup vcpkg from scratch if there is a cache-miss
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This one is not needed, as it is the default value anyway.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hosted-ninja-vcpkg_submod-triplet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This one is not needed, as it is the default value anyway.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hosted-ninja-vcpkg_submod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This one is not needed, as it is the default value anyway.
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/hosted-vcpkgconfigurationjson-support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
#
# The workflow does the following:
# - Instead of providing the Git commit id of the vcpkg repository, the registry builtin
# baseline from vcpkg-configuration.json is being used.

name: hosted-ninja-vcpkg-no-submod-nogitcommitid_vcpkgconfjson-cacheoff
on: [push, workflow_dispatch]

jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
with:
submodules: true
# This is useful to avoid https://github.com/microsoft/vcpkg/issues/25349
# which is caused by missing Git history on the vcpkg submodule which ports
# try to access.
# Do not use if not needed, since it slows down the checkout of sources.
fetch-depth: 0

- uses: lukka/get-cmake@latest
- name: List $RUNNER_WORKSPACE before vcpkg is setup
run: find $RUNNER_WORKSPACE
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This one is deliberately pointing to a non existing directory (so that vcpkg is not identified as a submodule of this repository).
vcpkgDirectory: '${{ github.workspace }}/vcpkg-support-json-test/vcpkg'
vcpkgJsonGlob: '**/cmakepresets/vcpkg.json'

- name: List $RUNNER_WORKSPACE before build
run: find $RUNNER_WORKSPACE
shell: bash
- name: Prints output of run-vcpkg's action.
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
- name: Run CMake+vcpkg+Ninja
uses: lukka/run-cmake@v10
id: runcmake
with:
cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt'
configurePreset: 'ninja-multi-vcpkg'
buildPreset: 'ninja-multi-vcpkg'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
shell: bash
57 changes: 57 additions & 0 deletions .github/workflows/hosted-vcpkgjson-support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
#
# The workflow does the following:
# - Instead of providing the Git commit id of the vcpkg repository, the builtin baseline
# from vcpkg.json is being used.

name: hosted-ninja-vcpkg-no-submod-nogitcommitid_vcpkgjson-cacheoff
on: [push, workflow_dispatch]

jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
with:
submodules: true
# This is useful to avoid https://github.com/microsoft/vcpkg/issues/25349
# which is caused by missing Git history on the vcpkg submodule which ports
# try to access.
# Do not use if not needed, since it slows down the checkout of sources.
fetch-depth: 0

- uses: lukka/get-cmake@latest
- name: List $RUNNER_WORKSPACE before vcpkg is setup
run: find $RUNNER_WORKSPACE
shell: bash

- name: Setup vcpkg
uses: lukka/run-vcpkg@dev/vcpkgconfjson-support
id: runvcpkg
with:
# This one is deliberately pointing to a non existing directory (so that vcpkg is not identified as a submodule of this repository).
vcpkgDirectory: '${{ github.workspace }}/cmakepresets+vcpkgconfigurejson/vcpkg'

- name: List $RUNNER_WORKSPACE before build
run: find $RUNNER_WORKSPACE
shell: bash
- name: Prints output of run-vcpkg's action.
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
- name: Run CMake+vcpkg+Ninja
uses: lukka/run-cmake@v10
id: runcmake
with:
cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt'
configurePreset: 'ninja-multi-vcpkg'
buildPreset: 'ninja-multi-vcpkg'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
shell: bash
21 changes: 21 additions & 0 deletions cmakepresets+vcpkgconfigurejson/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CMakeLists.txt

# Ensure to pick up the default triplet from the environment if any. This helps
# driving the vcpkg triplet in the same way either when starting vcpkg directly,
# or when letting CMake start vcpkg at configure/generate time.
# Note: this logic must happen before PROJECT command.
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "The vcpkg triplet")
endif()

cmake_minimum_required(VERSION 3.0)
project(test)

find_package(unofficial-sqlite3 CONFIG REQUIRED)

add_executable(main)
target_sources(main PRIVATE test.cpp)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
set_property(TARGET main PROPERTY CXX_STANDARD 20)

include(CPack)
Loading

0 comments on commit 3a5ce7c

Please sign in to comment.