Skip to content

Commit b8ad5ac

Browse files
Merge branch 'google:main' into benchmark_list_tests-work-with-benchmark-format=json-google#1642
2 parents e1b21e0 + 3d85343 commit b8ad5ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2443
-1433
lines changed

.github/install_bazel.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if ! bazel version; then
55
fi
66
echo "Installing wget and downloading $arch Bazel binary from GitHub releases."
77
yum install -y wget
8-
wget "https://github.com/bazelbuild/bazel/releases/download/6.3.0/bazel-6.3.0-linux-$arch" -O /usr/local/bin/bazel
8+
wget "https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-$arch" -O /usr/local/bin/bazel
99
chmod +x /usr/local/bin/bazel
1010
else
1111
# bazel is installed for the correct architecture

.github/libcxx-setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
# Checkout LLVM sources
6-
git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
6+
git clone --depth=1 --branch llvmorg-16.0.6 https://github.com/llvm/llvm-project.git llvm-project
77

88
## Setup libc++ options
99
if [ -z "$BUILD_32_BITS" ]; then

.github/workflows/bazel.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
1515
bzlmod: [false, true]
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: mount bazel cache
2020
uses: actions/cache@v3

.github/workflows/build-and-test.yml

+53-6
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,60 @@ jobs:
102102
- name: build
103103
run: cmake --build _build/ --config ${{ matrix.build_type }}
104104

105-
- name: setup test environment
106-
# Make sure gmock and benchmark DLLs can be found
107-
run: >
108-
echo "$((Get-Item .).FullName)/_build/bin/${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
109-
echo "$((Get-Item .).FullName)/_build/src/${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
110-
111105
- name: test
112106
run: ctest --test-dir _build/ -C ${{ matrix.build_type }} -VV
113107

108+
msys2:
109+
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }}
110+
runs-on: ${{ matrix.os }}
111+
defaults:
112+
run:
113+
shell: msys2 {0}
114+
strategy:
115+
fail-fast: false
116+
matrix:
117+
os: [ windows-latest ]
118+
msys2:
119+
- { msystem: MINGW64, arch: x86_64, family: GNU, compiler: g++ }
120+
- { msystem: MINGW32, arch: i686, family: GNU, compiler: g++ }
121+
- { msystem: CLANG64, arch: x86_64, family: LLVM, compiler: clang++ }
122+
- { msystem: CLANG32, arch: i686, family: LLVM, compiler: clang++ }
123+
- { msystem: UCRT64, arch: x86_64, family: GNU, compiler: g++ }
124+
build_type:
125+
- Debug
126+
- Release
127+
lib:
128+
- shared
129+
- static
130+
131+
steps:
132+
- uses: actions/checkout@v2
114133

134+
- name: Install Base Dependencies
135+
uses: msys2/setup-msys2@v2
136+
with:
137+
cache: false
138+
msystem: ${{ matrix.msys2.msystem }}
139+
update: true
140+
install: >-
141+
git
142+
base-devel
143+
pacboy: >-
144+
cc:p
145+
cmake:p
146+
ninja:p
147+
148+
- name: configure cmake
149+
env:
150+
CXX: ${{ matrix.msys2.compiler }}
151+
run: >
152+
cmake -S . -B _build/
153+
-GNinja
154+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
155+
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
156+
157+
- name: build
158+
run: cmake --build _build/ --config ${{ matrix.build_type }}
159+
160+
- name: test
161+
run: ctest --test-dir _build/ -C ${{ matrix.build_type }} -VV

.github/workflows/clang-format-lint.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
pull_request: {}
55

66
jobs:
7-
build:
7+
job:
8+
name: check-clang-format
89
runs-on: ubuntu-latest
910

1011
steps:

.github/workflows/pre-commit.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: python + Bazel pre-commit checks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
env:
13+
MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy"
14+
RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff"
15+
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.11
25+
cache: pip
26+
cache-dependency-path: pyproject.toml
27+
- name: Install dependencies
28+
run: python -m pip install ".[dev]"
29+
- name: Cache pre-commit tools
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
${{ env.MYPY_CACHE_DIR }}
34+
${{ env.RUFF_CACHE_DIR }}
35+
${{ env.PRE_COMMIT_HOME }}
36+
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-linter-cache
37+
- name: Run pre-commit checks
38+
run: pre-commit run --all-files --verbose --show-diff-on-failure

.github/workflows/pylint.yml

-28
This file was deleted.

.github/workflows/test_bindings.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ ubuntu-latest, macos-latest, windows-2019 ]
16+
os: [ ubuntu-latest, macos-latest, windows-latest ]
1717

1818
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python
21-
uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@v5
2224
with:
2325
python-version: 3.11
24-
- name: Install GBM Python bindings on ${{ matrix.os}}
25-
run:
26-
python -m pip install wheel .
26+
- name: Install GBM Python bindings on ${{ matrix.os }}
27+
run: python -m pip install .
2728
- name: Run bindings example on ${{ matrix.os }}
2829
run:
2930
python bindings/python/google_benchmark/example.py

.github/workflows/wheels.yml

+19-20
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out repo
15-
uses: actions/checkout@v3
16-
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
1718
- name: Install Python 3.11
18-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
1920
with:
2021
python-version: 3.11
21-
22-
- name: Build and check sdist
23-
run: |
24-
python setup.py sdist
25-
- name: Upload sdist
26-
uses: actions/upload-artifact@v3
22+
- run: python -m pip install build
23+
- name: Build sdist
24+
run: python -m build --sdist
25+
- uses: actions/upload-artifact@v3
2726
with:
2827
name: dist
2928
path: dist/*.tar.gz
@@ -33,22 +32,24 @@ jobs:
3332
runs-on: ${{ matrix.os }}
3433
strategy:
3534
matrix:
36-
os: [ubuntu-latest, macos-latest, windows-2019]
35+
os: [ubuntu-latest, macos-latest, windows-latest]
3736

3837
steps:
3938
- name: Check out Google Benchmark
40-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
4142

4243
- name: Set up QEMU
4344
if: runner.os == 'Linux'
44-
uses: docker/setup-qemu-action@v2
45+
uses: docker/setup-qemu-action@v3
4546
with:
4647
platforms: all
4748

4849
- name: Build wheels on ${{ matrix.os }} using cibuildwheel
49-
uses: pypa/cibuildwheel@v2.14.1
50+
uses: pypa/cibuildwheel@v2.16.2
5051
env:
51-
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
52+
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-* cp312-*'
5253
CIBW_SKIP: "*-musllinux_*"
5354
CIBW_TEST_SKIP: "*-macosx_arm64"
5455
CIBW_ARCHS_LINUX: x86_64 aarch64
@@ -61,19 +62,17 @@ jobs:
6162
uses: actions/upload-artifact@v3
6263
with:
6364
name: dist
64-
path: ./wheelhouse/*.whl
65+
path: wheelhouse/*.whl
6566

6667
pypi_upload:
6768
name: Publish google-benchmark wheels to PyPI
6869
needs: [build_sdist, build_wheels]
6970
runs-on: ubuntu-latest
71+
permissions:
72+
id-token: write
7073
steps:
7174
- uses: actions/download-artifact@v3
7275
with:
7376
name: dist
7477
path: dist
75-
76-
- uses: pypa/gh-action-pypi-publish@v1.6.4
77-
with:
78-
user: __token__
79-
password: ${{ secrets.PYPI_PASSWORD }}
78+
- uses: pypa/gh-action-pypi-publish@v1.8.11

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ rules.ninja
4646

4747
# bazel output symlinks.
4848
bazel-*
49+
MODULE.bazel.lock
4950

5051
# out-of-source build top-level folders.
5152
build/

.pre-commit-config.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/keith/pre-commit-buildifier
3+
rev: 6.4.0
4+
hooks:
5+
- id: buildifier
6+
- id: buildifier-lint
7+
- repo: https://github.com/pre-commit/mirrors-mypy
8+
rev: v1.8.0
9+
hooks:
10+
- id: mypy
11+
types_or: [ python, pyi ]
12+
args: [ "--ignore-missing-imports", "--scripts-are-modules" ]
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.1.13
15+
hooks:
16+
- id: ruff
17+
args: [ --fix, --exit-non-zero-on-fix ]
18+
- id: ruff-format

0 commit comments

Comments
 (0)