Skip to content

Commit dadaff1

Browse files
committed
Updating to use REPO_NAME instead of hardcoding
1 parent c3f9860 commit dadaff1

1 file changed

Lines changed: 23 additions & 21 deletions

File tree

.github/workflows/cmake-multi-platform.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ jobs:
121121
env:
122122
GRPC_BUILD_ENABLE_CCACHE: "ON"
123123
GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }}
124+
REPO_NAME: ${{ endsWith(github.repository, '/') && 'error' || replace(github.repository, github.repository_owner + '/', '') }}
125+
124126
runs-on: ${{ matrix.runner }}
125127
container:
126128
image: ${{ matrix.container }}
@@ -169,11 +171,11 @@ jobs:
169171
SUDO="sudo"
170172
fi
171173
172-
# Clean contents of rlp directory but keep the directory itself
173-
if [ -d "rlp" ]; then
174-
echo "Cleaning rlp directory contents..."
175-
$SUDO rm -rf rlp/* rlp/.* 2>/dev/null || true
176-
echo "rlp directory cleaned (kept the directory)"
174+
# Clean contents of ${{ REPO_NAME }} directory but keep the directory itself
175+
if [ -d "${{ REPO_NAME }}" ]; then
176+
echo "Cleaning directory contents..."
177+
$SUDO rm -rf ${{ REPO_NAME }}/* ${{ REPO_NAME }}/.* 2>/dev/null || true
178+
echo "${{ REPO_NAME }} directory cleaned (kept the directory)"
177179
fi
178180
179181
# Delete sibling dependency directories completely
@@ -187,15 +189,15 @@ jobs:
187189
echo "=== POST-CLEANUP DEBUG ==="
188190
echo "Runner workspace contents:"
189191
ls -la
190-
if [ -d "rlp" ]; then
191-
echo "rlp directory exists and contains:"
192-
ls -la rlp/ 2>/dev/null || echo " (empty)"
192+
if [ -d "${{ REPO_NAME }}" ]; then
193+
echo "${{ REPO_NAME }} directory exists and contains:"
194+
ls -la ${{ REPO_NAME }}/ 2>/dev/null || echo " (empty)"
193195
fi
194196
195-
- name: Checkout rlp repository
197+
- name: Checkout ${{ REPO_NAME }} repository
196198
uses: actions/checkout@v6
197199
with:
198-
path: "rlp"
200+
path: "${{ REPO_NAME }}"
199201
submodules: "recursive"
200202

201203
- name: Set build directory
@@ -397,38 +399,38 @@ jobs:
397399

398400
- name: Configure CMake for Android
399401
if: ${{ matrix.target == 'Android'}}
400-
working-directory: ${{github.workspace}}/rlp
402+
working-directory: ${{github.workspace}}/${{ REPO_NAME }}
401403
run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DANDROID_ABI=${{matrix.abi}} -DTHIRDPARTY_BUILD_DIR=${{env.THIRDPARTY_BUILD_DIR}} -DZKLLVM_BUILD_DIR=${{env.ZKLLVM_BUILD_DIR}}
402404

403405
- name: Configure CMake for Mac
404406
if: ${{ matrix.target == 'OSX'}}
405-
working-directory: ${{github.workspace}}/rlp
407+
working-directory: ${{github.workspace}}/${{ REPO_NAME }}
406408
run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DPLATFORM=MAC_UNIVERSAL -DTHIRDPARTY_BUILD_DIR=${{env.THIRDPARTY_BUILD_DIR}} -DZKLLVM_BUILD_DIR=${{env.ZKLLVM_BUILD_DIR}}
407409

408410
- name: Configure CMake for iOS
409411
if: ${{ matrix.target == 'iOS'}}
410-
working-directory: ${{github.workspace}}/rlp
412+
working-directory: ${{github.workspace}}/${{ REPO_NAME }}
411413
run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DPLATFORM=OS64 -DTHIRDPARTY_BUILD_DIR=${{env.THIRDPARTY_BUILD_DIR}} -DZKLLVM_BUILD_DIR=${{env.ZKLLVM_BUILD_DIR}}
412414

413415
- name: Configure CMake for Linux
414416
if: ${{matrix.target == 'Linux'}}
415-
working-directory: ${{ github.workspace }}/rlp
417+
working-directory: ${{ github.workspace }}/${{ REPO_NAME }}
416418
run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_BUILD_DIR=${{env.THIRDPARTY_BUILD_DIR}} -DZKLLVM_BUILD_DIR=${{env.ZKLLVM_BUILD_DIR}} -DSGNS_PRINT_LOGS=ON
417419

418420
- name: Configure CMake for Windows
419421
if: ${{matrix.target == 'Windows'}}
420-
working-directory: ${{github.workspace}}/rlp
422+
working-directory: ${{github.workspace}}/${{ REPO_NAME }}
421423
run: cmake -S build/${{matrix.target}} -B $env:BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_BUILD_DIR=${{env.THIRDPARTY_BUILD_DIR}} -DZKLLVM_BUILD_DIR=${{env.ZKLLVM_BUILD_DIR}}
422424

423-
- name: Build rlp
424-
working-directory: ${{ github.workspace }}/rlp/${{ env.BUILD_DIRECTORY }}
425+
- name: Build ${{ REPO_NAME }}
426+
working-directory: ${{ github.workspace }}/${{ REPO_NAME }}/${{ env.BUILD_DIRECTORY }}
425427
run: cmake --build . --config ${{ matrix.build-type }} -j
426428

427-
- name: Test rlp (non-mobile)
429+
- name: Test ${{ REPO_NAME }} (non-mobile)
428430
if: ${{ matrix.target != 'Android' && matrix.target != 'iOS' }}
429-
working-directory: ${{ github.workspace }}/rlp/${{ env.BUILD_DIRECTORY }}
431+
working-directory: ${{ github.workspace }}/${{ REPO_NAME }}/${{ env.BUILD_DIRECTORY }}
430432
run: ctest . -C ${{ matrix.build-type }} --output-on-failure -V
431433

432-
- name: Install rlp
433-
working-directory: ${{ github.workspace }}/rlp/${{ env.BUILD_DIRECTORY }}
434+
- name: Install ${{ REPO_NAME }}
435+
working-directory: ${{ github.workspace }}/${{ REPO_NAME }}/${{ env.BUILD_DIRECTORY }}
434436
run: cmake --install . --config ${{ matrix.build-type }}

0 commit comments

Comments
 (0)