replace random function to make CI reproducible #2007
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is a demo of how to run all examples in the Icicle repository. | |
# For each language directory (c++, Rust, etc.) the workflow | |
# (1) loops over all examples (msm, ntt, etc.) and | |
# (2) runs ./run.sh in each directory. | |
# Each script should return 0 for success and 1 otherwise. | |
name: Examples | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-changed-files: | |
uses: ./.github/workflows/check-changed-files.yml | |
extract-cuda-backend-branch: | |
uses: ./.github/workflows/extract-backends.yml | |
with: | |
pr-number: ${{ github.event.pull_request.number }} | |
run-examples: | |
runs-on: [self-hosted, Linux, X64, icicle, examples] | |
needs: [check-changed-files, extract-cuda-backend-branch] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout CUDA Backend | |
uses: actions/checkout@v4 | |
with: | |
repository: ingonyama-zk/icicle-cuda-backend | |
path: ./icicle/backend/cuda | |
ssh-key: ${{ secrets.CUDA_PULL_KEY }} | |
ref: ${{ needs.extract-cuda-backend-branch.outputs.cuda-backend-branch }} | |
- name: c++ examples | |
working-directory: ./examples/c++ | |
if: needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.examples == 'true' | |
run: | | |
# loop over all directories in the current directory | |
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do | |
if [ -d "$dir" ]; then | |
echo "Running command in $dir" | |
cd $dir | |
./run.sh -d CUDA | |
cd - | |
fi | |
done | |
- name: Rust examples | |
working-directory: ./examples/rust | |
if: needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.examples == 'true' | |
run: | | |
# loop over all directories in the current directory | |
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do | |
if [ -d "$dir" ]; then | |
echo "Running command in $dir" | |
cd $dir | |
./run.sh -d CUDA | |
cd - | |
fi | |
done |