parent
f48c668e0d
commit
8dc14f688c
6 changed files with 60 additions and 83 deletions
@ -0,0 +1,30 @@ |
||||
name: Staleness tests |
||||
|
||||
on: |
||||
schedule: |
||||
# Run daily at 10 AM UTC (2 AM PDT) |
||||
- cron: 0 10 * * * |
||||
|
||||
permissions: {} |
||||
jobs: |
||||
test: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
branch: [main, 22.x] |
||||
os: [{ name: Linux, value: ubuntu-latest}] |
||||
|
||||
name: ${{ matrix.os.name }} ${{ matrix.branch}} |
||||
runs-on: ${{ matrix.os.value }} |
||||
steps: |
||||
- name: Checkout ${{ matrix.branch }} |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ matrix.branch}} |
||||
|
||||
- name: Run all staleness tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }} |
||||
bash: bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS |
@ -1,4 +1,4 @@ |
||||
name: Auto-generate checked-in files |
||||
name: Auto-generate stale checked-in files |
||||
|
||||
on: |
||||
push: |
@ -1,64 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
if [[ -z "${CONTAINER_IMAGE}" ]]; then |
||||
CONTAINER_IMAGE=us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1 |
||||
fi |
||||
|
||||
cd $(dirname $0)/../.. |
||||
GIT_REPO_ROOT=`pwd` |
||||
|
||||
ENVS=() |
||||
|
||||
# Check for specific versions pinned to the docker image. In these cases we |
||||
# want to forward the environment variable to tests, so that they can verify |
||||
# that the correct version is being picked up by Bazel. |
||||
ENVS+=("--test_env=KOKORO_JAVA_VERSION") |
||||
ENVS+=("--test_env=KOKORO_PYTHON_VERSION") |
||||
ENVS+=("--test_env=KOKORO_RUBY_VERSION") |
||||
|
||||
if [ -n "$BAZEL_ENV" ]; then |
||||
for env in $BAZEL_ENV; do |
||||
ENVS+="--action_env=${env}" |
||||
done |
||||
fi |
||||
|
||||
# Setup GAR for docker images. |
||||
gcloud components update --quiet |
||||
gcloud auth configure-docker us-docker.pkg.dev --quiet |
||||
|
||||
function run { |
||||
local CONFIG=$1 |
||||
local BAZEL_CONFIG=$2 |
||||
|
||||
tmpfile=$(mktemp -u) |
||||
|
||||
rm -rf $GIT_REPO_ROOT/bazel-out $GIT_REPO_ROOT/bazel-bin |
||||
rm -rf $GIT_REPO_ROOT/logs |
||||
|
||||
docker run \ |
||||
--cidfile $tmpfile \ |
||||
--cap-add=SYS_PTRACE \ |
||||
-v $GIT_REPO_ROOT:/workspace \ |
||||
$CONTAINER_IMAGE \ |
||||
test \ |
||||
$(${GIT_REPO_ROOT}/kokoro/common/bazel_flags.sh) \ |
||||
${ENVS[@]} \ |
||||
$PLATFORM_CONFIG \ |
||||
$BAZEL_CONFIG \ |
||||
$BAZEL_EXTRA_FLAGS \ |
||||
$BAZEL_TARGETS |
||||
|
||||
# Save logs for Kokoro |
||||
docker cp \ |
||||
`cat $tmpfile`:/workspace/logs $KOKORO_ARTIFACTS_DIR/$CONFIG |
||||
} |
||||
|
||||
if [ -n "$BAZEL_CONFIGS" ]; then |
||||
for config in $BAZEL_CONFIGS; do |
||||
run $config "--config=$config" |
||||
done |
||||
else |
||||
run |
||||
fi |
@ -1,18 +0,0 @@ |
||||
# We run our staleness tests as release-type jobs only. They are not really |
||||
# part of the release process, but the release job type allows us to run the |
||||
# tests on a schedule only (not presubmit or postsubmit). |
||||
|
||||
# Location of the build script in repository |
||||
build_file: "protobuf/kokoro/linux/bazel.sh" |
||||
timeout_mins: 15 |
||||
|
||||
env_vars { |
||||
key: "BAZEL_TARGETS" |
||||
value: "//src:cmake_lists_staleness_test" |
||||
} |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "**/sponge_log.*" |
||||
} |
||||
} |
Loading…
Reference in new issue