Skip to content

build: update ci #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- 'example'
- 'fuzz'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run clang-format style check.
uses: jidicula/[email protected]
with:
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ jobs:

steps:
- name: Checkout codebase
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup bazel
uses: jwlawson/actions-setup-bazel@v1
uses: jwlawson/actions-setup-bazel@v2
with:
bazel-version: "latest"

- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
with:
version: ${{ env.GCC_VERSION }}

run: |
sudo apt-get install -y gcc-12 g++-12
- name: Install lcov
run: |
sudo apt install lcov
Expand All @@ -35,15 +33,15 @@ jobs:
genhtml --output bazel-coverage-html ./coverage.dat

- name: upload coverage artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
bazel-coverage-html
coverage.dat

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: coverage.dat
verbose: true
12 changes: 6 additions & 6 deletions .github/workflows/test_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
llvm_version: ['11', '13.0.0', '15']
llvm_version: ['11', '16.0.4', '17']
tool: ['cmake', 'bazel']
arch: [westmere, haswell]
exclude:
Expand All @@ -18,16 +18,16 @@ jobs:
CXX: clang++

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ matrix.llvm_version }}

- name: Setup bazel
if: matrix.tool == 'bazel'
uses: jwlawson/actions-setup-bazel@v1
uses: jwlawson/actions-setup-bazel@v2
with:
bazel-version: "latest"

Expand Down Expand Up @@ -70,15 +70,15 @@ jobs:
CXX: g++-${{ matrix.gcc_version}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install GCC
run: |
sudo apt-get install -y gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}

- name: Setup bazel
if: matrix.tool == 'bazel'
uses: jwlawson/actions-setup-bazel@v1
uses: jwlawson/actions-setup-bazel@v2
with:
bazel-version: "latest"

Expand Down
14 changes: 5 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ cc_test(
]),
deps = [
":string_view",
"@gtest//:gtest_main",
"@googletest//:gtest_main",
],
data = glob([ "testdata/*.json"]),
linkopts = [ '-lstdc++fs', '-fstack-protector-all',] +\
Expand Down Expand Up @@ -155,14 +155,13 @@ cc_test(
cc_test(
name = "unittest-clang",
srcs = glob([
"tests/*.h",
"tests/*.cpp",
"include/sonic/*",
"include/sonic/**/*",
]),
deps = [
":string_view",
"@gtest//:gtest_main",
"@googletest//:gtest_main",
],
data = glob([ "testdata/*.json"]),
linkopts = sanitize_copts + [
Expand All @@ -179,14 +178,13 @@ cc_test(
cc_test(
name = "unittest-arm",
srcs = glob([
"tests/*.h",
"tests/*.cpp",
"include/sonic/*",
"include/sonic/**/*",
]),
deps = [
":string_view",
"@gtest//:gtest_main",
"@googletest//:gtest_main",
],
data = glob([ "testdata/*.json"]),
linkopts = sanitize_copts + [
Expand All @@ -203,14 +201,13 @@ cc_test(
cc_test(
name = "unittest-sse",
srcs = glob([
"tests/*.h",
"tests/*.cpp",
"include/sonic/*",
"include/sonic/**/*",
]),
deps = [
":string_view",
"@gtest//:gtest_main",
"@googletest//:gtest_main",
],
data = glob([ "testdata/*.json"]),
linkopts = sanitize_copts + [
Expand All @@ -229,11 +226,10 @@ cc_test(
name = "unittest-gcc-coverage",
srcs = glob([
"tests/*.cpp",
"tests/*.h",
]),
deps = [
":sonic-cpp",
"@gtest//:gtest_main",
"@googletest//:gtest_main",
],
data = glob([
"testdata/*.json",
Expand Down
46 changes: 46 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "google_benchmark", version = "1.9.1")
bazel_dep(name = "googletest", version = "1.16.0")

new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

new_git_repository(
name = "rapidjson",
branch = "master",
build_file = "//:bazel/rapidjson.BUILD",
remote = "https://github.com/Tencent/rapidjson.git",
)

new_git_repository(
name = "cJSON",
branch = "master",
build_file = "//:bazel/cJSON.BUILD",
remote = "https://github.com/DaveGamble/cJSON.git",
)

new_git_repository(
name = "simdjson",
branch = "master",
build_file = "//:bazel/simdjson.BUILD",
remote = "https://github.com/simdjson/simdjson.git",
)

new_git_repository(
name = "yyjson",
branch = "master",
build_file = "//:bazel/yyjson.BUILD",
remote = "https://github.com/ibireme/yyjson.git",
)

git_repository(
name = "jsoncpp",
branch = "master",
remote = "https://github.com/open-source-parsers/jsoncpp",
)
File renamed without changes.
1 change: 1 addition & 0 deletions tests/document_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <dirent.h>

#include <algorithm>
#include <fstream>
#include <iostream>
#include <map>
Expand Down