diff options
author | Dominic Hamon <dominichamon@users.noreply.github.com> | 2020-09-10 16:32:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 16:32:25 +0100 |
commit | df9e2948fa7bfca1ddf530ae2b23a518ed55fab1 (patch) | |
tree | 9400ac69e9464b805c0247fe1b0b2fef0d7520ac | |
parent | 12e85b2eeb6df095b1366a44d8e8464599b5e1b8 (diff) | |
download | google-benchmark-df9e2948fa7bfca1ddf530ae2b23a518ed55fab1.tar.gz |
Add workflow to exercise bindings (#1041)
* Initial version to try to run python bindings example
* python indent issue in setup.py
* better naming
-rw-r--r-- | .github/workflows/test_bindings.yml | 24 | ||||
-rw-r--r-- | setup.py | 22 |
2 files changed, 35 insertions, 11 deletions
diff --git a/.github/workflows/test_bindings.yml b/.github/workflows/test_bindings.yml new file mode 100644 index 0000000..273d7f9 --- /dev/null +++ b/.github/workflows/test_bindings.yml @@ -0,0 +1,24 @@ +name: test-bindings + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + python_bindings: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install benchmark + run: + python setup.py install + - name: Run example bindings + run: + python bindings/python/google_benchmark/example.py @@ -83,17 +83,17 @@ class BuildBazelExtension(build_ext.build_ext): for library_dir in self.library_dirs: bazel_argv.append('--linkopt=/LIBPATH:' + library_dir) - self.spawn(bazel_argv) - - shared_lib_suffix = '.dll' if IS_WINDOWS else '.so' - ext_bazel_bin_path = os.path.join( - self.build_temp, 'bazel-bin', - ext.relpath, ext.target_name + shared_lib_suffix) - ext_dest_path = self.get_ext_fullpath(ext.name) - ext_dest_dir = os.path.dirname(ext_dest_path) - if not os.path.exists(ext_dest_dir): - os.makedirs(ext_dest_dir) - shutil.copyfile(ext_bazel_bin_path, ext_dest_path) + self.spawn(bazel_argv) + + shared_lib_suffix = '.dll' if IS_WINDOWS else '.so' + ext_bazel_bin_path = os.path.join( + self.build_temp, 'bazel-bin', + ext.relpath, ext.target_name + shared_lib_suffix) + ext_dest_path = self.get_ext_fullpath(ext.name) + ext_dest_dir = os.path.dirname(ext_dest_path) + if not os.path.exists(ext_dest_dir): + os.makedirs(ext_dest_dir) + shutil.copyfile(ext_bazel_bin_path, ext_dest_path) setuptools.setup( |