-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
161 changed files
with
14,894 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# NB: sematics here are not the same as .gitignore | ||
# see https://github.com/bazelbuild/bazel/issues/8106 | ||
# Ignore backup files. | ||
*~ | ||
# Ignore Vim swap files. | ||
.*.swp | ||
# Ignore files generated by IDEs. | ||
/.aswb/ | ||
/.cache/ | ||
/.classpath | ||
/.clwb/ | ||
/.factorypath | ||
/.idea/ | ||
/.ijwb/ | ||
/.project | ||
/.settings | ||
/.vscode/ | ||
/bazel.iml | ||
# Ignore all bazel-* symlinks. There is no full list since this can change | ||
# based on the name of the directory bazel is cloned into. | ||
/bazel-* | ||
# Ignore outputs generated during Bazel bootstrapping. | ||
/output/ | ||
# Ignore jekyll build output. | ||
/production | ||
/.sass-cache | ||
# Bazelisk version file | ||
.bazelversion | ||
# User-specific .bazelrc | ||
user.bazelrc | ||
|
||
/t/ | ||
/spec/ | ||
/spec-ee/ | ||
/servroot/ | ||
/autodoc/ | ||
/.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Bazel doesn't need more than 200MB of memory for local build based on memory profiling: | ||
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling | ||
# The default JVM max heapsize is 1/4 of physical memory up to 32GB which could be large | ||
# enough to consume all memory constrained by cgroup in large host. | ||
# Limiting JVM heapsize here to let it do GC more when approaching the limit to | ||
# leave room for compiler/linker. | ||
# The number 3G is chosen heuristically to both support large VM and small VM with RBE. | ||
# Startup options cannot be selected via config. | ||
startup --host_jvm_args=-Xmx512m | ||
|
||
run --color=yes | ||
|
||
common --color=yes | ||
common --curses=auto | ||
|
||
build --experimental_ui_max_stdouterr_bytes=10485760 | ||
|
||
build --show_progress_rate_limit=0 | ||
build --show_timestamps | ||
build --worker_verbose | ||
|
||
build --incompatible_strict_action_env | ||
|
||
# Enable --platforms API based cpu,compiler,crosstool_top selection; remove this in 7.0.0 as it's enabled by default | ||
build --incompatible_enable_cc_toolchain_resolution | ||
|
||
# Pass PATH, CC, CXX variables from the environment. | ||
build --action_env=CC --host_action_env=CC | ||
build --action_env=CXX --host_action_env=CXX | ||
build --action_env=PATH --host_action_env=PATH | ||
|
||
build --action_env=BAZEL_BUILD=1 | ||
|
||
# temporary fix for https://github.com/bazelbuild/bazel/issues/12905 on macOS | ||
build --features=-debug_prefix_map_pwd_is_dot | ||
|
||
# Build flags. | ||
build --action_env=BUILD_NAME=kong-dev | ||
build --action_env=INSTALL_DESTDIR=MANAGED | ||
build --strip=never | ||
|
||
# Release flags | ||
build:release --//:debug=false | ||
build:release --action_env=BUILD_NAME=kong-dev | ||
build:release --action_env=INSTALL_DESTDIR=/usr/local | ||
build:release --copt="-g" | ||
build:release --strip=never | ||
|
||
build --spawn_strategy=local | ||
|
||
build --action_env=GITHUB_TOKEN --host_action_env=GITHUB_TOKEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
-- Aggregates stats from multiple luacov stat files. | ||
-- Example stats for a 12 lines file `my/file.lua` | ||
-- that received hits on lines 3, 4, 9: | ||
-- | ||
-- ["my/file.lua"] = { | ||
-- [3] = 1, | ||
-- [4] = 3, | ||
-- [9] = 2, | ||
-- max = 12, | ||
-- max_hits = 3 | ||
-- } | ||
-- | ||
|
||
local luacov_stats = require "luacov.stats" | ||
local luacov_reporter = require "luacov.reporter" | ||
local luacov_runner = require "luacov.runner" | ||
local lfs = require "lfs" | ||
|
||
|
||
-- load parameters | ||
local params = {...} | ||
local stats_folders_prefix = params[1] or "luacov-stats-out-" | ||
local file_name = params[2] or "luacov.stats.out" | ||
local strip_prefix = params[3] or "" | ||
local base_path = "." | ||
|
||
|
||
-- load stats from different folders named using the format: | ||
-- luacov-stats-out-${timestamp} | ||
local loaded_stats = {} | ||
for folder in lfs.dir(base_path) do | ||
if folder:find(stats_folders_prefix, 1, true) then | ||
local stats_file = folder .. "/" .. file_name | ||
local loaded = luacov_stats.load(stats_file) | ||
if loaded then | ||
loaded_stats[#loaded_stats + 1] = loaded | ||
print("loading file: " .. stats_file) | ||
end | ||
end | ||
end | ||
|
||
|
||
-- aggregate | ||
luacov_runner.load_config() | ||
for _, stat_data in ipairs(loaded_stats) do | ||
-- make all paths relative to ensure file keys have the same format | ||
-- and avoid having separate counters for the same file | ||
local rel_stat_data = {} | ||
for f_name, data in pairs(stat_data) do | ||
if f_name:sub(0, #strip_prefix) == strip_prefix then | ||
f_name = f_name:sub(#strip_prefix + 1) | ||
end | ||
rel_stat_data[f_name] = data | ||
end | ||
|
||
luacov_runner.data = rel_stat_data | ||
luacov_runner.save_stats() | ||
end | ||
|
||
|
||
-- generate report | ||
luacov_reporter.report() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
FROM kong/kong:2.7.0 | ||
FROM kong/kong:3.0.0-ubuntu | ||
|
||
USER root | ||
|
||
RUN apk add --update \ | ||
alpine-sdk \ | ||
build-base \ | ||
bsd-compat-headers \ | ||
m4 | ||
RUN apt-get update | ||
|
||
RUN apt-get install -y \ | ||
build-essential \ | ||
unzip \ | ||
git \ | ||
m4 \ | ||
libyaml-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build Cache Key | ||
|
||
description: > | ||
Generates a cache key suitable for save/restore of Kong builds. | ||
inputs: | ||
prefix: | ||
description: 'String prefix applied to the build cache key' | ||
required: false | ||
default: 'build' | ||
extra: | ||
description: 'Additional values/file hashes to use in the cache key' | ||
required: false | ||
|
||
outputs: | ||
cache-key: | ||
description: 'The generated cache key' | ||
value: ${{ steps.cache-key.outputs.CACHE_KEY }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Generate cache key | ||
id: cache-key | ||
shell: bash | ||
env: | ||
PREFIX: ${{ inputs.prefix }} | ||
EXTRA: ${{ inputs.extra }} | ||
run: | | ||
# please keep these sorted | ||
FILE_HASHES=( | ||
${{ hashFiles('.bazelignore') }} | ||
${{ hashFiles('.bazelrc') }} | ||
${{ hashFiles('.bazelversion') }} | ||
${{ hashFiles('.github/actions/build-cache-key/**') }} | ||
${{ hashFiles('.github/workflows/build.yml') }} | ||
${{ hashFiles('.requirements') }} | ||
${{ hashFiles('BUILD.bazel') }} | ||
${{ hashFiles('WORKSPACE') }} | ||
${{ hashFiles('bin/kong') }} | ||
${{ hashFiles('bin/kong-health') }} | ||
${{ hashFiles('build/**') }} | ||
${{ hashFiles('kong-*.rockspec') }} | ||
${{ hashFiles('kong.conf.default') }} | ||
) | ||
if [[ -n ${EXTRA:-} ]]; then | ||
readarray \ | ||
-O "${#FILE_HASHES[@]}" \ | ||
-t \ | ||
FILE_HASHES \ | ||
<<< "$EXTRA" | ||
fi | ||
HASH=$(printf '%s\n' "${FILE_HASHES[@]}" \ | ||
| grep -vE '^$' \ | ||
| sort --stable --unique \ | ||
| sha256sum - \ | ||
| awk '{print $1}' | ||
) | ||
echo "CACHE_KEY=${PREFIX}::${HASH}" | tee -a $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.