Skip to content

Commit

Permalink
gh: simplify dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Feb 29, 2024
1 parent 6f3790e commit 4385e33
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ env:
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
# Use specific vcpkg version
VCPKG_COMMIT_ID: '5568f110b509a9fd90711978a7cb76bae75bb092'
# Setup clang
CC: clang-18
CXX: clang++-18

jobs:
build:
Expand All @@ -28,13 +31,12 @@ jobs:
- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
sudo apt-get update
sudo apt-get install -y \
gpg wget curl zip unzip tar git pkg-config \
ninja-build clang-tidy cppcheck ccache build-essential \
doctest-dev clang-17 libstdc++-12-dev
ninja-build make clang-tidy cppcheck ccache gcc g++ \
doctest-dev clang-18 lld-18 libstdc++-12-dev
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
Expand All @@ -50,9 +52,4 @@ jobs:
vcpkgJsonGlob: 'vcpkg.json'

- name: Run cmake
uses: lukka/run-cmake@v10
with:
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER=clang-17', '-DCMAKE_CXX_COMPILER=clang++-17']"
configurePreset: 'ninja-multi-vcpkg'
buildPreset: 'ninja-vcpkg-deb'
testPreset: 'ninja-vcpkg-deb'
run: cmake --workflow --preset ci
36 changes: 34 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": 3,
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 22,
"minor": 28,
"patch": 0
},
"configurePresets": [
Expand Down Expand Up @@ -30,6 +30,14 @@
"name": "ninja-multi-vcpkg-doctest",
"displayName": "Ninja Multi-Config Configure Settings with doctest",
"inherits": [ "ninja-multi-vcpkg", "with-doctest" ]
},
{
"name": "ci",
"inherits": "ninja-multi-vcpkg-doctest",
"cacheVariables": {
"CMAKE_C_COMPILER": "$env{CC}",
"CMAKE_CXX_COMPILER": "$env{CXX}"
}
}
],

Expand Down Expand Up @@ -57,6 +65,11 @@
"configurePreset": "ninja-multi-vcpkg-doctest",
"displayName": "Build ninja-multi-vcpkg-release-doctest",
"configuration": "Release"
},
{
"name": "ci",
"configurePreset": "ci",
"configuration": "Debug"
}
],

Expand All @@ -76,6 +89,25 @@
"verbosity": "verbose"
},
"configuration": "Debug"
},
{
"name": "ci",
"configurePreset": "ci",
"configuration": "Debug",
"output": {
"verbosity": "verbose"
}
}
],

"workflowPresets": [
{
"name": "ci",
"steps": [
{ "type": "configure", "name": "ci" },
{ "type": "build", "name": "ci" },
{ "type": "test", "name": "ci" }
]
}
]
}

0 comments on commit 4385e33

Please sign in to comment.