Merge pull request #449 from kroma-network/docs/update-circom-readme #4
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
name: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
bazel_config: linux | |
- os: macos-latest-xlarge | |
bazel_config: macos_arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Bazel | |
uses: bazelbuild/setup-bazelisk@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install numpy | |
run: python3 -m pip install numpy | |
- name: Install OpenMP on linux | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y libomp-dev | |
- name: Install OpenMP on macos | |
if: matrix.os == 'macos-latest-xlarge' | |
run: brew install libomp | |
- name: Add .bazelrc.user on linux | |
if: matrix.os == 'ubuntu-latest' | |
run: echo "build --config linux" > .bazelrc.user && | |
echo "build --action_env=CARGO=$HOME/.cargo/bin/cargo" >> .bazelrc.user | |
- name: Add .bazelrc.user on macos | |
if: matrix.os == 'macos-latest-xlarge' | |
run: brew install coreutils && | |
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH" && | |
echo "build --config macos_arm64" > .bazelrc.user && | |
echo "build --action_env=CARGO=$HOME/.cargo/bin/cargo" >> .bazelrc.user | |
- name: Build | |
run: bazel build -c fastbuild //... | |
- name: Test Tachyon (fastbuild) | |
# NOTE(chokobole): Test timeouts are overridden 1.5x of the default timeout due to timeout failure on GitHub Actions. | |
# See https://github.com/kroma-network/tachyon/actions/runs/9581476338/job/26418352737. | |
run: bazel test -c fastbuild --test_output=errors --test_tag_filters -benchmark,-manual,-cuda //... --test_timeout=90,450,1350,5400 | |
- name: Test Tachyon (optimized) | |
run: bazel test -c opt --test_output=errors --test_tag_filters -benchmark,-manual,-cuda //... | |
- name: Test OpenMP | |
# NOTE(TomTaehoonKim): Test timeouts are overridden 1.5x of the default timeout due to timeout failure on GitHub Actions by change in | |
# https://github.com/kroma-network/tachyon/pull/309. See https://github.com/kroma-network/tachyon/actions/runs/7984233709/job/21800735269. | |
run: bazel test -c fastbuild --//:has_openmp --test_output=errors --test_tag_filters -benchmark,-manual,-cuda //... --test_timeout=90,450,1350,5400 | |
- name: Test Node Binding | |
run: | | |
cd tachyon/node/test | |
bazel test --config ${{ matrix.bazel_config }} --test_output=errors //... | |
- name: Test Py Binding | |
# TODO(chokobole): Remove this condition once we fix https://github.com/kroma-network/tachyon/issues/197. | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd tachyon/py/test | |
bazel test --config ${{ matrix.bazel_config }} --test_output=errors //... | |
- name: Test Circom | |
run: | | |
cd vendors/circom | |
CARGO_BAZEL_REPIN=true bazel test --config ${{ matrix.bazel_config }} --test_output=errors //... | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Git | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email 'github-actions@github.com' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git fetch --all | |
- name: Setup Python for cpplint | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10.12" | |
- name: Install cpplint | |
run: pip install cpplint | |
- name: Run cpplint | |
if: github.event_name == 'pull_request' | |
run: git diff --name-only HEAD origin/${{ github.base_ref }} | xargs cpplint --filter=-legal/copyright,-whitespace/line_length,-build/namespaces,-runtime/references | |
- name: Run clang-format lint | |
uses: jidicula/clang-format-action@v4.11.0 | |
with: | |
clang-format-version: "17" | |
check-path: "." | |
- name: Install Buildifier | |
run: | | |
wget https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64 | |
chmod +x buildifier-linux-amd64 | |
sudo mv buildifier-linux-amd64 /usr/local/bin/buildifier | |
- name: Run Buildifier | |
run: | | |
find . -iname "*.bazel" -o -iname "*.bzl" | xargs buildifier --lint=fix | |
find . -iname "*.bazel" -o -iname "*.bzl" | xargs buildifier --mode=check | |
git diff --exit-code |