Skip to content

Commit

Permalink
Github workflow for running PSI-cardinality installation and benchmar…
Browse files Browse the repository at this point in the history
…k tests for every PR (#31)
  • Loading branch information
rutujasurve94 authored May 12, 2020
1 parent 65c93ca commit 812aaf9
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .flake8
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
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
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

0 comments on commit 812aaf9

Please sign in to comment.