Skip to content

Commit 23e21ab

Browse files
committed
change id and steps
1 parent 4b7accb commit 23e21ab

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/cpp-golang-rust.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373

7474
test-curve:
7575
name: Test Curve on ${{ matrix.backend }} with ${{ matrix.runner_os }}
76-
# runs-on: [self-hosted, Linux, X64, icicle]
7776
runs-on: ${{ matrix.runner }}
7877
needs: [check-changed-files, check-format, extract-cuda-backend-branch, extract-metal-backend-branch]
7978
strategy:
@@ -126,16 +125,16 @@ jobs:
126125
working-directory: ./icicle/backend/${{ matrix.backend }}
127126
id: extract-backend-sha
128127
run: |
129-
${{ matrix.backend_upper }}BACKEND_SHA=$(git rev-parse HEAD)
130-
echo "${{ matrix.backend_upper }} Backend Commit SHA: $${{ matrix.backend_upper }}_BACKEND_SHA"
131-
echo "${{ matrix.backend }}-backend-sha=$${{ matrix.backend_upper }}_BACKEND_SHA" >> $GITHUB_OUTPUT
128+
BACKEND_SHA=$(git rev-parse HEAD)
129+
echo "Backend Commit SHA: $BACKEND_SHA"
130+
echo "${{ matrix.backend }}-backend-sha=$BACKEND_SHA" >> $GITHUB_ENV
132131
- name: Set ${{ matrix.backend_upper }} backend flag
133132
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.rust == 'true'
134133
id: backend-flag
135134
run: |
136-
${{ matrix.backend_upper }}_BACKEND_SHA=${{ steps.extract-${{ matrix.backend }}-sha.outputs.${{ matrix.backend }}-backend-sha }}
135+
BACKEND_SHA=${{ env.${{ matrix.backend }}-backend-sha }}
137136
CURVE=${{ matrix.curve.name }}
138-
COMMIT_FILE="gh_commit_sha_${CURVE}_${${{ matrix.backend_upper }}_BACKEND_SHA}"
137+
COMMIT_FILE="gh_commit_sha_${CURVE}_${BACKEND_SHA}"
139138
if [ "${{ needs.extract-${{ matrix.backend }}-backend-branch.outputs.${{ matrix.backend }}-backend-branch }}" == "main" ]; then
140139
INSTALL_PATH=${{ github.workspace }}/../../main_lib/curve/$CURVE
141140
echo "INSTALL_PATH=${{ github.workspace }}/../../main_lib/curve/$CURVE" >> $GITHUB_OUTPUT
@@ -174,23 +173,23 @@ jobs:
174173
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.rust == 'true'
175174
run: |
176175
mkdir -p build && rm -rf build/*
177-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DCURVE=${{ matrix.curve.name }} ${{ matrix.curve.build_args }} ${{ steps.${{ matrix.backend }}-flag.outputs.${{ matrix.backend_upper }}_FLAG }} ${{ steps.${{ matrix.backend }}-flag.outputs.CMAKE_INSTALL_PREFIX }} -S . -B build
176+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DCURVE=${{ matrix.curve.name }} ${{ matrix.curve.build_args }} ${{ steps.backend-flag.outputs.${{ matrix.backend_upper }}_FLAG }} ${{ steps.backend-flag.outputs.CMAKE_INSTALL_PREFIX }} -S . -B build
178177
cmake --build build --target install -j
179-
rm -rf ${{ steps.${{ matrix.backend }}-flag.outputs.INSTALL_PATH }}/lib/gh_commit_sha_${{ matrix.curve.name }}*
180-
touch ${{ steps.${{ matrix.backend }}-flag.outputs.COMMIT_FILE_PATH }}
178+
rm -rf ${{ steps.backend-flag.outputs.INSTALL_PATH }}/lib/gh_commit_sha_${{ matrix.curve.name }}*
179+
touch ${{ steps.backend-flag.outputs.COMMIT_FILE_PATH }}
181180
182181
- name: Run C++ Curve Tests
183182
working-directory: ./icicle/build/tests
184183
if: needs.check-changed-files.outputs.cpp == 'true'
185184
run: |
186-
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.${{ matrix.backend }}-flag.outputs.ICICLE_BACKEND_INSTALL_DIR }}
185+
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.backend-flag.outputs.ICICLE_BACKEND_INSTALL_DIR }}
187186
ctest --output-on-failure
188187
- name: Run C++ examples
189188
working-directory: ./examples/c++
190189
if: needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.examples == 'true'
191190
run: |
192191
CURVE=${{ matrix.curve.name }}
193-
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.${{ matrix.backend }}-flag.outputs.ICICLE_BACKEND_INSTALL_DIR }}
192+
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.backend-flag.outputs.ICICLE_BACKEND_INSTALL_DIR }}
194193
for dir in $(grep -l -r "\\-DCURVE=$CURVE" . | xargs -L1 dirname | sort -u); do
195194
if [ -d "$dir" ]; then
196195
echo "Running command in $dir"
@@ -223,7 +222,7 @@ jobs:
223222
CURVE=${{ matrix.curve.name }}
224223
CURVE_DIR=$(echo ${{ matrix.curve.name }} | sed -e 's/_//g')
225224
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.cuda-flag.outputs.ICICLE_BACKEND_INSTALL_DIR }}
226-
export LD_LIBRARY_PATH=${{ steps.${{ matrix.backend }}-flag.outputs.INSTALL_PATH }}/lib
225+
export LD_LIBRARY_PATH=${{ steps.backend-flag.outputs.INSTALL_PATH }}/lib
227226
export CGO_LDFLAGS="-L$LD_LIBRARY_PATH -licicle_field_$CURVE -licicle_curve_$CURVE -lstdc++ -Wl,-rpath=LD_LIBRARY_PATH"
228227
go test ./$CURVE_DIR/tests -count=1 -failfast -p 2 -timeout 60m -v
229228

0 commit comments

Comments
 (0)