Skip to content

Commit e2a3a89

Browse files
authored
use conan utils from reusable workflow (#46)
1 parent 75d7bb2 commit e2a3a89

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

.github/workflows/code_testing.yml

+7-30
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,7 @@ jobs:
2424
runs-on: ${{ matrix.config.os }}
2525
steps:
2626
- name: Add repos for for gcc-13 and clang-16
27-
run: |
28-
# gcc-13
29-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
30-
31-
# clang-16
32-
source /etc/os-release
33-
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
34-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-16.gpg > /dev/null
35-
36-
sudo apt-get update -y
27+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/setup_apt@main
3728

3829
- name: Install CMake
3930
uses: lukka/[email protected]
@@ -50,23 +41,12 @@ jobs:
5041
uses: rui314/setup-mold@v1
5142

5243
- name: Configure conan
44+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/configure_conan@main
45+
with:
46+
conan-version: 2.3.1
47+
48+
- name: add conan user
5349
run: |
54-
pip3 install conan==2.3.0
55-
56-
# conan profile update is deprecated (https://github.com/conan-io/conan/issues/13205)
57-
# and they don't want you to use detect because it is unstable
58-
59-
conan profile detect # Force creation of conan directory structure, will be overwritten
60-
61-
echo '{% set compiler, version, c_exe = detect_api.detect_default_compiler() %}' > ~/.conan2/profiles/default
62-
echo '[settings]' >> ~/.conan2/profiles/default
63-
echo 'os={{ detect_api.detect_os() }}' >> ~/.conan2/profiles/default
64-
echo 'arch={{ detect_api.detect_arch() }}' >> ~/.conan2/profiles/default
65-
echo 'build_type=Release' >> ~/.conan2/profiles/default
66-
echo 'compiler={{ compiler }}' >> ~/.conan2/profiles/default
67-
echo 'compiler.version={{ detect_api.default_compiler_version(compiler, version) }}' >> ~/.conan2/profiles/default
68-
echo 'compiler.libcxx=libstdc++11' >> ~/.conan2/profiles/default
69-
7050
conan remote add -f dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
7151
7252
- name: Cache conan data
@@ -79,10 +59,7 @@ jobs:
7959
- uses: actions/[email protected]
8060

8161
- name: Get dependency provider
82-
run: |
83-
sudo apt-get install -y wget
84-
85-
wget https://github.com/conan-io/cmake-conan/raw/develop2/conan_provider.cmake -O conan_provider.cmake
62+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/add_conan_provider@main
8663

8764
- name: Configure CMake
8865
run: cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DBUILD_EXAMPLES=On -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -G Ninja -B build .

0 commit comments

Comments
 (0)