|
38 | 38 | env:
|
39 | 39 | CC: gcc
|
40 | 40 | CXX: g++
|
41 |
| - CONAN_USER_HOME: "${{github.workspace}}" |
| 41 | + |
42 | 42 | steps:
|
43 | 43 | - name: Install sccache from cache
|
44 | 44 | id: cache-sccache
|
@@ -69,77 +69,75 @@ jobs:
|
69 | 69 | curl -L "${{matrix.toolchain}}" | tar -C toolchain -xz --strip-components=1
|
70 | 70 |
|
71 | 71 | - name: Install Conan
|
72 |
| - run: pip install --no-cache-dir 'conan==1.66.0' --force-reinstall |
| 72 | + run: pip install --no-cache-dir conan --force-reinstall |
| 73 | + |
| 74 | + - name: Restore sccache |
| 75 | + uses: actions/cache@v4 |
| 76 | + with: |
| 77 | + path: ~/.cache/sccache |
| 78 | + key: sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}-${{github.run_id}} |
| 79 | + restore-keys: | |
| 80 | + sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}- |
| 81 | + sccache-${{matrix.arch}}-${{github.base_ref||github.event.repository.default_branch}}- |
| 82 | +
|
| 83 | + - name: Checkout sources |
| 84 | + uses: actions/checkout@v4 |
| 85 | + with: |
| 86 | + path: src |
73 | 87 |
|
74 | 88 | - name: Create Conan configuration
|
| 89 | + working-directory: ${{github.workspace}}/src |
75 | 90 | run: |
|
76 |
| - # init config |
77 |
| - CONAN_V2_MODE=1 conan config init |
78 |
| - conan config set general.revisions_enabled=1 |
79 |
| - # add custom compiler settings for libc |
80 |
| - python3 -c 'import yaml; p = "${{env.CONAN_USER_HOME}}/.conan/settings.yml"; d = yaml.safe_load(open(p)); d["compiler"]["gcc"]["libc"] = ["None", "glibc", "musl"]; yaml.safe_dump(d, open(p, "w"))' |
| 91 | + mkdir build/ |
| 92 | + conan config list |
| 93 | + python3 -c 'import yaml; p = "build/settings.yml"; d = yaml.safe_load(open(p)); d["compiler"]["gcc"]["libc"] = ["glibc", "musl"]; yaml.safe_dump(d, open(p, "w"))' |
| 94 | + conan profile detect |
| 95 | + echo "compiler.libc=glibc" >> $(conan profile path default) |
| 96 | +
|
81 | 97 |
|
82 | 98 | - name: Create Conan host profile
|
| 99 | + working-directory: ${{github.workspace}}/src |
83 | 100 | run: |
|
84 |
| - cat > "${{env.CONAN_USER_HOME}}/.conan/profiles/host" << "EOF" |
| 101 | + cat > "$(conan config home)/profiles/host" << "EOF" |
85 | 102 | [settings]
|
86 | 103 | os=Linux
|
87 |
| - os_build=Linux |
88 | 104 | arch=${{matrix.conan_arch}}
|
89 |
| - arch_build=x86_64 |
90 | 105 | compiler=gcc
|
91 | 106 | compiler.version=11
|
| 107 | + compiler.cppstd=17 |
92 | 108 | compiler.libcxx=libstdc++11
|
93 | 109 | compiler.libc=musl
|
94 | 110 | build_type=Release
|
95 |
| - [build_requires] |
96 |
| - [env] |
| 111 | + [buildenv] |
97 | 112 | CC=${{github.workspace}}/toolchain/bin/${{matrix.cc}}
|
98 | 113 | CXX=${{github.workspace}}/toolchain/bin/${{matrix.cxx}}
|
99 | 114 | LDFLAGS=${{matrix.ldflags}}
|
100 | 115 | EOF
|
101 | 116 |
|
102 |
| - - name: Restore sccache |
103 |
| - uses: actions/cache@v4 |
104 |
| - with: |
105 |
| - path: ~/.cache/sccache |
106 |
| - key: sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}-${{github.run_id}} |
107 |
| - restore-keys: | |
108 |
| - sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}- |
109 |
| - sccache-${{matrix.arch}}-${{github.base_ref||github.event.repository.default_branch}}- |
110 |
| -
|
111 |
| - - name: Checkout sources |
112 |
| - uses: actions/checkout@v4 |
113 |
| - with: |
114 |
| - path: src |
115 |
| - |
116 |
| - - name: Remove crashpad from conanfile |
117 |
| - run: sed -i "/crashpad/d" ${{github.workspace}}/src/conanfile.py |
118 |
| - |
119 | 117 | - name: Install dependencies
|
| 118 | + working-directory: ${{github.workspace}}/src |
120 | 119 | run: |
|
121 |
| - mkdir build |
122 |
| - cd build |
123 |
| - conan install -pr:b default -pr:h host -g virtualenv --build=missing "${{github.workspace}}/src" |
| 120 | + conan install . -pr:b=default -pr:h="host" --build=missing |
124 | 121 |
|
125 | 122 | - name: Configure
|
| 123 | + working-directory: ${{github.workspace}}/src/build |
126 | 124 | run: |
|
127 |
| - cd build |
128 |
| - source environment.sh.env |
129 | 125 | export CC CXX
|
130 | 126 | export LDFLAGS=-static
|
131 |
| - cmake "${{github.workspace}}/src" \ |
| 127 | + source Release/generators/conanbuild.sh |
| 128 | + cmake .. \ |
132 | 129 | -DCMAKE_BUILD_TYPE=Release \
|
| 130 | + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake \ |
| 131 | + -DCONAN_HOST_PROFILE="host" \ |
| 132 | + -DCONAN_INSTALL_ARGS=--build=never \ |
133 | 133 | -DCRASHPAD_NOT_SUPPORTED=true \
|
134 | 134 | -DCMAKE_C_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" -DCMAKE_CXX_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" \
|
135 |
| - -DPKTVISOR_CONAN_INIT=OFF -DPKTVISOR_CONAN_BUILD="never" -DPKTVISOR_CONAN_BUILD_PROFILE="default" -DPKTVISOR_CONAN_HOST_PROFILE="host" \ |
136 | 135 | -DCORRADE_RC_PROGRAM=$(command -v corrade-rc) \
|
137 | 136 | -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic
|
138 | 137 |
|
139 | 138 | - name: Build
|
140 |
| - run: | |
141 |
| - cd build |
142 |
| - make -j4 VERBOSE=1 |
| 139 | + working-directory: ${{github.workspace}}/src/build |
| 140 | + run: make -j4 VERBOSE=1 |
143 | 141 |
|
144 | 142 | - name: Print sccache stats
|
145 | 143 | run: |
|
@@ -175,7 +173,7 @@ jobs:
|
175 | 173 |
|
176 | 174 | - name: Configure CMake to generate VERSION
|
177 | 175 | shell: bash
|
178 |
| - run: VERSION_ONLY=1 cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release |
| 176 | + run: VERSION_ONLY=1 cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake |
179 | 177 |
|
180 | 178 | - name: Rename folder and copy version
|
181 | 179 | shell: bash
|
|
0 commit comments