| load( |
| "@io_bazel_rules_docker//container:container.bzl", |
| "container_image", |
| "container_push", |
| ) |
| load("@rules_pkg//:pkg.bzl", "pkg_tar") |
| load("@debs//file:packages.bzl", "packages") |
| load("//:debs.bzl", "get_dep_list") |
| |
| pkg_tar( |
| name = "lcov_configs", |
| package_dir = "/lcov", |
| srcs = [ |
| "lcov/lcov.css", |
| "lcov/emerald.png", |
| "lcov/ruby.png", |
| ], |
| ) |
| |
| # build container using kunit.sh and latest kunitconfig from gerrit |
| container_image( |
| name = "kunit", |
| base = "@debian_base//image", |
| debs = [packages[x] for x in get_dep_list()], |
| directory = "/", |
| entrypoint = "/kunit.sh", |
| files = [ |
| "kunit.sh", |
| "@kunitconfig_repo//:kunitconfig", |
| ], |
| tars = ["lcov_configs"], |
| mode = "777", |
| repository = "kunit-presubmit/kunit", |
| ) |
| |
| container_push( |
| name = "push_kunit", |
| format = "Docker", |
| image = ":kunit", |
| registry = "gcr.io", |
| repository = "kunit-presubmit/kunit", |
| tag = "latest", |
| ) |
| |
| # build test container using latest kunit source |
| container_image( |
| name = "kunit_test", |
| base = ":kunit", |
| directory = "/kunit/linux", |
| env = {"ARTIFACTS": "kunit/artifacts"}, |
| repository = "kunit-presubmit/test", |
| tars = ["@kunit_repo//:files"], |
| workdir = "/kunit/linux", |
| ) |
| |
| py_library( |
| name = "lcov_parser", |
| srcs = ["lcov_parser/lcov_parser.py"], |
| ) |
| |
| py_test( |
| name = "lcov_parser_test", |
| srcs = ["lcov_parser/lcov_parser_test.py"], |
| python_version = "PY3", |
| deps = ["lcov_parser/lcov_parser.py"], |
| ) |