-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github workflow for running PSI-cardinality installation and benchmar…
…k tests for every PR (#31)
- Loading branch information
1 parent
65c93ca
commit 812aaf9
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[flake8] | ||
select = E901,E999,F821,F822,F823 | ||
max-line-length = 100 | ||
exclude = .git,.eggs,__pycache__,build,dist,venv,third_party,tutorials | ||
max-complexity = 11 | ||
show-source = true | ||
statistics = true | ||
count = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- '**.cpp' | ||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
paths: | ||
- '**.cpp' | ||
|
||
jobs: | ||
PSI-cpp-tests: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-18.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies - Bazel | ||
run: | | ||
sudo apt update | ||
sudo apt install cmake clang | ||
# Step 1: Install the JDK (optional) | ||
sudo apt-get install openjdk-11-jdk | ||
# Step 2: Add Bazel distribution URI as a package source | ||
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list | ||
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - | ||
# Step 3: Install and update Bazel | ||
sudo apt-get update && sudo apt-get install bazel | ||
sudo apt-get install --only-upgrade bazel | ||
- name: Lint with clang-format | ||
run: | | ||
# lint files (all .cpp and .h files) inplace | ||
find ./psi-cardinality/ \( -iname *.h -o -iname *.cpp \) | xargs clang-format -i -style='google' | ||
# print changes | ||
git diff | ||
# already well formated if 'git diff' doesn't output | ||
! ( git diff | grep -q ^ ) || return 1 | ||
- name: Build the library | ||
run: | | ||
# fetch third_party libraries | ||
git submodule init && git submodule update | ||
# build the cpp library | ||
bazel build //psi_cardinality/cpp/... | ||
- name: Run tests | ||
run: | | ||
bazel test //psi_cardinality/cpp/... | ||
- name: Run benchmark tests | ||
run: | | ||
bazel run -c opt //psi_cardinality/cpp:psi_cardinality_benchmark |