@@ -3,11 +3,6 @@ name: Build and test configuration
33on :
44 workflow_call :
55 inputs :
6- build_dir :
7- description : " The directory where to build."
8- required : true
9- type : string
10-
116 build_only :
127 description : ' Whether to only build or to build and test the code ("true", "false").'
138 required : true
@@ -59,6 +54,11 @@ defaults:
5954 run :
6055 shell : bash
6156
57+ env :
58+ # Conan installs the generators in the build/generators directory, see the
59+ # layout() method in conanfile.py. We then run CMake from the build directory.
60+ BUILD_DIR : build
61+
6262jobs :
6363 build-and-test :
6464 name : ${{ inputs.config_name }}
@@ -71,21 +71,21 @@ jobs:
7171 steps :
7272 - name : Cleanup workspace (macOS and Windows)
7373 if : ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
74- uses : XRPLF/actions/.github/actions/ cleanup-workspace@01b244d2718865d427b499822fbd3f15e7197fcc
74+ uses : XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6
7575
7676 - name : Checkout repository
7777 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
7878
7979 - name : Prepare runner
80- uses : XRPLF/actions/.github/actions/ prepare-runner@99685816bb60a95a66852f212f382580e180df3a
80+ uses : XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6
8181 with :
8282 disable_ccache : false
8383
8484 - name : Print build environment
8585 uses : ./.github/actions/print-env
8686
8787 - name : Get number of processors
88- uses : XRPLF/actions/.github/actions/ get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
88+ uses : XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6
8989 id : nproc
9090 with :
9191 subtract : ${{ inputs.nproc_subtract }}
@@ -96,15 +96,14 @@ jobs:
9696 - name : Build dependencies
9797 uses : ./.github/actions/build-deps
9898 with :
99- build_dir : ${{ inputs.build_dir }}
10099 build_nproc : ${{ steps.nproc.outputs.nproc }}
101100 build_type : ${{ inputs.build_type }}
102101 # Set the verbosity to "quiet" for Windows to avoid an excessive
103102 # amount of logs. For other OSes, the "verbose" logs are more useful.
104103 log_verbosity : ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
105104
106105 - name : Configure CMake
107- working-directory : ${{ inputs.build_dir }}
106+ working-directory : ${{ env.BUILD_DIR }}
108107 env :
109108 BUILD_TYPE : ${{ inputs.build_type }}
110109 CMAKE_ARGS : ${{ inputs.cmake_args }}
@@ -117,7 +116,7 @@ jobs:
117116 ..
118117
119118 - name : Build the binary
120- working-directory : ${{ inputs.build_dir }}
119+ working-directory : ${{ env.BUILD_DIR }}
121120 env :
122121 BUILD_NPROC : ${{ steps.nproc.outputs.nproc }}
123122 BUILD_TYPE : ${{ inputs.build_type }}
@@ -132,8 +131,6 @@ jobs:
132131 - name : Upload the binary (Linux)
133132 if : ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }}
134133 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
135- env :
136- BUILD_DIR : ${{ inputs.build_dir }}
137134 with :
138135 name : xrpld-${{ inputs.config_name }}
139136 path : ${{ env.BUILD_DIR }}/xrpld
@@ -142,7 +139,7 @@ jobs:
142139
143140 - name : Check linking (Linux)
144141 if : ${{ runner.os == 'Linux' }}
145- working-directory : ${{ inputs.build_dir }}
142+ working-directory : ${{ env.BUILD_DIR }}
146143 run : |
147144 ldd ./xrpld
148145 if [ "$(ldd ./xrpld | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
@@ -154,13 +151,13 @@ jobs:
154151
155152 - name : Verify presence of instrumentation (Linux)
156153 if : ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }}
157- working-directory : ${{ inputs.build_dir }}
154+ working-directory : ${{ env.BUILD_DIR }}
158155 run : |
159156 ./xrpld --version | grep libvoidstar
160157
161158 - name : Run the separate tests
162159 if : ${{ !inputs.build_only }}
163- working-directory : ${{ inputs.build_dir }}
160+ working-directory : ${{ env.BUILD_DIR }}
164161 # Windows locks some of the build files while running tests, and parallel jobs can collide
165162 env :
166163 BUILD_TYPE : ${{ inputs.build_type }}
@@ -173,7 +170,7 @@ jobs:
173170
174171 - name : Run the embedded tests
175172 if : ${{ !inputs.build_only }}
176- working-directory : ${{ runner.os == 'Windows' && format('{0}/{1}', inputs.build_dir , inputs.build_type) || inputs.build_dir }}
173+ working-directory : ${{ runner.os == 'Windows' && format('{0}/{1}', env.BUILD_DIR , inputs.build_type) || env.BUILD_DIR }}
177174 env :
178175 BUILD_NPROC : ${{ steps.nproc.outputs.nproc }}
179176 run : |
@@ -189,7 +186,7 @@ jobs:
189186
190187 - name : Prepare coverage report
191188 if : ${{ !inputs.build_only && env.ENABLED_COVERAGE == 'true' }}
192- working-directory : ${{ inputs.build_dir }}
189+ working-directory : ${{ env.BUILD_DIR }}
193190 env :
194191 BUILD_NPROC : ${{ steps.nproc.outputs.nproc }}
195192 BUILD_TYPE : ${{ inputs.build_type }}
@@ -207,7 +204,7 @@ jobs:
207204 disable_search : true
208205 disable_telem : true
209206 fail_ci_if_error : true
210- files : ${{ inputs.build_dir }}/coverage.xml
207+ files : ${{ env.BUILD_DIR }}/coverage.xml
211208 plugins : noop
212209 token : ${{ secrets.CODECOV_TOKEN }}
213210 verbose : true
0 commit comments