bf42f2b9e9
Bumps the ci_dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [benchmark-action/github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) | `1.20.7` | `1.21.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.0.0` | | [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.0.0` | | [actions/setup-node](https://github.com/actions/setup-node) | `6.2.0` | `6.3.0` | | [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `47.0.4` | `47.0.5` | Updates `benchmark-action/github-action-benchmark` from 1.20.7 to 1.21.0 - [Release notes](https://github.com/benchmark-action/github-action-benchmark/releases) - [Changelog](https://github.com/benchmark-action/github-action-benchmark/blob/master/CHANGELOG.md) - [Commits](https://github.com/benchmark-action/github-action-benchmark/compare/4bdcce38c94cec68da58d012ac24b7b1155efe8b...a7bc2366eda11037936ea57d811a43b3418d3073) Updates `docker/build-push-action` from 6.19.2 to 7.0.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/10e90e3645eae34f1e60eeb005ba3a3d33f178e8...d08e5c354a6adb9ed34480a06d141179aa583294) Updates `docker/login-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/c94ce9fb468520275223c153574b00df6fe4bcc9...b45d80f862d83dbcd57f89517bcf500b2ab88fb2) Updates `actions/setup-node` from 6.2.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/6044e13b5dc448c55e2357c09f80417699197238...53b83947a5a98c8d113130e565377fae1a50d02f) Updates `tj-actions/changed-files` from 47.0.4 to 47.0.5 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/7dee1b0c1557f278e5c7dc244927139d78c0e22a...22103cc46bda19c2b464ffe86db46df6922fd323) --- updated-dependencies: - dependency-name: benchmark-action/github-action-benchmark dependency-version: 1.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ci_dependencies - dependency-name: docker/build-push-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci_dependencies - dependency-name: docker/login-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci_dependencies - dependency-name: actions/setup-node dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ci_dependencies - dependency-name: tj-actions/changed-files dependency-version: 47.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ci_dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
347 lines
14 KiB
YAML
347 lines
14 KiB
YAML
# Reusable workflow to set various useful variables
|
|
# and to perform checks and generate conditions for other workflows.
|
|
# Currently it checks if any Rust (build-related) file is changed
|
|
# and if the current (caller) workflow file is changed.
|
|
# Example:
|
|
#
|
|
# jobs:
|
|
# preflight:
|
|
# uses: ./.github/workflows/reusable-preflight.yml
|
|
# some-job:
|
|
# needs: changes
|
|
# if: ${{ needs.preflight.outputs.changes_rust }}
|
|
# .......
|
|
|
|
name: Zombienet Preflight
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tests_yaml:
|
|
required: true
|
|
type: string
|
|
test_pattern:
|
|
required: false
|
|
type: string
|
|
build_run_id:
|
|
required: true
|
|
type: string
|
|
description: "Build run ID from the build workflow."
|
|
ref_slug:
|
|
required: false
|
|
type: string
|
|
# Map the workflow outputs to job outputs
|
|
outputs:
|
|
changes_bizinikiwi:
|
|
value: ${{ jobs.preflight.outputs.changes_bizinikiwi }}
|
|
description: |
|
|
True iff there are changes in bizinikiwi directory or the current workflow
|
|
|
|
changes_pezcumulus:
|
|
value: ${{ jobs.preflight.outputs.changes_pezcumulus }}
|
|
description: |
|
|
True iff there are changes in pezcumulus directory or the current workflow
|
|
|
|
changes_pezkuwi:
|
|
value: ${{ jobs.preflight.outputs.changes_pezkuwi }}
|
|
description: |
|
|
True iff there are changes in pezkuwi directory or the current workflow
|
|
|
|
changes_bridges:
|
|
value: ${{ jobs.preflight.outputs.changes_bridges }}
|
|
description: |
|
|
True iff there are changes in bridges directory or the current workflow
|
|
|
|
changes_templates:
|
|
value: ${{ jobs.preflight.outputs.changes_templates }}
|
|
description: |
|
|
True iff there are changes in templates directory or the current workflow
|
|
|
|
changes_zombienet:
|
|
value: ${{ jobs.preflight.outputs.changes_zombienet }}
|
|
description: |
|
|
True iff there are changes in zombienet tests/actions/scripts or the current workflow
|
|
|
|
CI_IMAGE:
|
|
value: ${{ jobs.preflight.outputs.CI_IMAGE }}
|
|
description: "CI image"
|
|
|
|
DOCKER_IMAGES_VERSION:
|
|
value: ${{ jobs.preflight.outputs.DOCKER_IMAGES_VERSION }}
|
|
description: |
|
|
Version for temp docker images.
|
|
|
|
SOURCE_REF_SLUG:
|
|
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}
|
|
|
|
BUILD_RUN_ID:
|
|
value: ${{ inputs.build_run_id }}
|
|
description: |
|
|
Id of the build run, needed to download the artifacts.
|
|
|
|
# zombienet related vars
|
|
ZOMBIENET_PROVIDER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_PROVIDER }}
|
|
description: "Provider to use in zombienet tests."
|
|
|
|
ZOMBIENET_IMAGE:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_IMAGE }}
|
|
description: "ZOMBIENET CI image"
|
|
|
|
ZOMBIENET_DEFAULT_RUNNER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER }}
|
|
description: |
|
|
Main runner for zombienet tests.
|
|
|
|
ZOMBIENET_LARGE_RUNNER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_LARGE_RUNNER }}
|
|
description: |
|
|
Large runner for zombienet tests.
|
|
|
|
DEBUG:
|
|
value: ${{ jobs.preflight.outputs.DEBUG }}
|
|
description: "Debug value to zombienet v1 tests."
|
|
|
|
# zombienet-sdk related vars
|
|
ZOMBIE_PROVIDER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIE_PROVIDER }}
|
|
description: "Provider to use in zombienet-sdk tests."
|
|
RUST_LOG:
|
|
value: ${{ jobs.preflight.outputs.RUST_LOG }}
|
|
description: "Log value to use in zombinet-sdk tests."
|
|
|
|
ZOMBIENET_SDK_DEFAULT_RUNNER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER }}
|
|
description: |
|
|
Main runner for zombienet-sdk tests.
|
|
|
|
ZOMBIENET_SDK_LARGE_RUNNER:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_SDK_LARGE_RUNNER }}
|
|
description: |
|
|
Large runner for zombienet-sdk tests.
|
|
|
|
ZOMBIENET_SDK_IMAGE:
|
|
value: ${{ jobs.preflight.outputs.ZOMBIENET_SDK_IMAGE }}
|
|
description: "zombienet-sdk CI image"
|
|
|
|
# common vars
|
|
PUSHGATEWAY_URL:
|
|
value: ${{ jobs.preflight.outputs.PUSHGATEWAY_URL }}
|
|
description: "Gateway (url) to push metrics related to test."
|
|
|
|
KUBERNETES_CPU_REQUEST:
|
|
value: ${{ jobs.preflight.outputs.KUBERNETES_CPU_REQUEST }}
|
|
description: "Base cpu (request) for pod runner."
|
|
|
|
KUBERNETES_MEMORY_REQUEST:
|
|
value: ${{ jobs.preflight.outputs.KUBERNETES_MEMORY_REQUEST }}
|
|
description: "Base memory (request) for pod runner."
|
|
|
|
TEMP_IMAGES_BASE:
|
|
value: ${{ jobs.preflight.outputs.TEMP_IMAGES_BASE }}
|
|
description: |
|
|
Base location for 'temp' images used in tests.
|
|
|
|
FLAKY_TESTS:
|
|
value: ${{ jobs.preflight.outputs.FLAKY_TESTS }}
|
|
description: |
|
|
comma separated list of flaky tests to skip.
|
|
|
|
TEST_MATRIX:
|
|
value: ${{ jobs.preflight.outputs.TEST_MATRIX }}
|
|
description: |
|
|
JSON formatted test matrix parsed from test yaml
|
|
jobs:
|
|
#
|
|
#
|
|
#
|
|
preflight:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch' || ! contains(github.event.pull_request.labels.*.name, 'T19-skip-zombienet_tests')
|
|
|
|
outputs:
|
|
changes_bizinikiwi: ${{ steps.set_changes.outputs.bizinikiwi_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
changes_pezcumulus: ${{ steps.set_changes.outputs.pezcumulus_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
changes_pezkuwi: ${{ steps.set_changes.outputs.pezkuwi_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
changes_bridges: ${{ steps.set_changes.outputs.bridges_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
changes_templates: ${{ steps.set_changes.outputs.templates_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
changes_zombienet: ${{ steps.set_changes.outputs.zombienet_any_changed == 'true' || steps.set_changes.outputs.currentWorkflow_any_changed == 'true' }}
|
|
|
|
CI_IMAGE: ${{ steps.set_vars.outputs.IMAGE }}
|
|
|
|
# images versions
|
|
DOCKER_IMAGES_VERSION: ${{ steps.set_images_version.outputs.DOCKER_IMAGES_VERSION }}
|
|
|
|
SOURCE_REF_SLUG: ${{ steps.set_vars.outputs.SOURCE_REF_SLUG }}
|
|
|
|
# zombienet-env vars
|
|
ZOMBIENET_PROVIDER: ${{ steps.set_vars.outputs.ZOMBIENET_PROVIDER }}
|
|
ZOMBIENET_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_IMAGE }}
|
|
ZOMBIENET_DEFAULT_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_DEFAULT_RUNNER }}
|
|
ZOMBIENET_LARGE_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_LARGE_RUNNER }}
|
|
PUSHGATEWAY_URL: ${{ steps.set_vars.outputs.PUSHGATEWAY_URL }}
|
|
DEBUG: ${{ steps.set_vars.outputs.DEBUG }}
|
|
KUBERNETES_CPU_REQUEST: ${{ steps.set_vars.outputs.KUBERNETES_CPU_REQUEST }}
|
|
KUBERNETES_MEMORY_REQUEST: ${{ steps.set_vars.outputs.KUBERNETES_MEMORY_REQUEST }}
|
|
TEMP_IMAGES_BASE: ${{ steps.set_vars.outputs.TEMP_IMAGES_BASE }}
|
|
FLAKY_TESTS: ${{ steps.set_vars.outputs.FLAKY_TESTS }}
|
|
TEST_MATRIX: ${{ steps.generate_test_matrix.outputs.TEST_MATRIX }}
|
|
|
|
# zombienet-sdk vars
|
|
RUST_LOG: ${{ steps.set_vars.outputs.RUST_LOG }}
|
|
ZOMBIE_PROVIDER: ${{ steps.set_vars.outputs.ZOMBIE_PROVIDER }}
|
|
ZOMBIENET_SDK_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_IMAGE }}
|
|
ZOMBIENET_SDK_DEFAULT_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER }}
|
|
ZOMBIENET_SDK_LARGE_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_LARGE_RUNNER }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
#
|
|
# Set changes
|
|
#
|
|
- name: Current file
|
|
id: current_file
|
|
shell: bash
|
|
run: |
|
|
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
|
|
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set changes
|
|
id: set_changes
|
|
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 #v47.0.5
|
|
with:
|
|
files_yaml: |
|
|
bizinikiwi:
|
|
- 'bizinikiwi/**/*'
|
|
pezcumulus:
|
|
- 'pezcumulus/**/*'
|
|
pezkuwi:
|
|
- 'pezkuwi/**/*'
|
|
bridges:
|
|
- 'bridges/**/*'
|
|
templates:
|
|
- 'templates/**/*'
|
|
zombienet:
|
|
- '.github/zombienet-tests/**/*'
|
|
- '.github/actions/zombienet/**'
|
|
- '.github/actions/zombienet-sdk/**'
|
|
- '.github/scripts/parse-zombienet-tests.py'
|
|
- '.github/scripts/process-logs-zombienet.sh'
|
|
- '.github/workflows/zombienet*.yml'
|
|
currentWorkflow:
|
|
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
|
|
- '.github/workflows/zombienet-reusable-preflight.yml'
|
|
- '.github/zombienet-env'
|
|
- '.github/zombienet-flaky-tests'
|
|
|
|
#
|
|
# Set environment vars (including runner/image)
|
|
#
|
|
- name: Set vars
|
|
id: set_vars
|
|
shell: bash
|
|
env:
|
|
INPUT_REF_SLUG: ${{ inputs.ref_slug }}
|
|
run: |
|
|
# Determine SOURCE_REF_SLUG
|
|
if [[ -n "${INPUT_REF_SLUG}" ]]; then
|
|
echo "Using provided ref_slug: ${INPUT_REF_SLUG}"
|
|
SOURCE_REF_SLUG="${INPUT_REF_SLUG}"
|
|
else
|
|
echo "Calculating ref_slug from current context"
|
|
export SOURCE_REF_NAME=${{ github.head_ref || github.ref_name }}
|
|
SOURCE_REF_SLUG="${SOURCE_REF_NAME//\//_}"
|
|
fi
|
|
|
|
{
|
|
echo "SOURCE_REF_SLUG=${SOURCE_REF_SLUG}"
|
|
|
|
# filter out comments and empty lines
|
|
cat .github/zombienet-env | grep -Ev '^\s*#|^\s*$'
|
|
. .github/zombienet-env
|
|
|
|
# Determine if we should use persistent runners (for merge queues)
|
|
RUNNER_SUFFIX=""
|
|
if [[ $GITHUB_REF_NAME == *"gh-readonly-queue"* ]]; then
|
|
RUNNER_SUFFIX="_PERSISTENT"
|
|
fi
|
|
|
|
# Set zombienet v1 configuration
|
|
if [[ "$ZOMBIENET_PROVIDER" == "native" ]]; then
|
|
echo "ZOMBIENET_IMAGE=${ZOMBIENET_IMAGE_FOR_NATIVE}"
|
|
DEFAULT_RUNNER_VAR="ZOMBIENET_DEFAULT_RUNNER_FOR_NATIVE${RUNNER_SUFFIX}"
|
|
LARGE_RUNNER_VAR="ZOMBIENET_LARGE_RUNNER_FOR_NATIVE${RUNNER_SUFFIX}"
|
|
echo "ZOMBIENET_DEFAULT_RUNNER=${!DEFAULT_RUNNER_VAR}"
|
|
echo "ZOMBIENET_LARGE_RUNNER=${!LARGE_RUNNER_VAR}"
|
|
else
|
|
echo "ZOMBIENET_IMAGE=${ZOMBIENET_IMAGE_FOR_K8S}"
|
|
# runner size for k8s is not relevant, it "only" spawns pods and runs the test
|
|
echo "ZOMBIENET_DEFAULT_RUNNER=${ZOMBIENET_RUNNER_FOR_K8S}"
|
|
echo "ZOMBIENET_LARGE_RUNNER=${ZOMBIENET_RUNNER_FOR_K8S}"
|
|
fi
|
|
|
|
if [[ "$ZOMBIE_PROVIDER" == "native" ]]; then
|
|
echo "ZOMBIENET_SDK_IMAGE=${ZOMBIENET_SDK_IMAGE_FOR_NATIVE}"
|
|
SDK_DEFAULT_RUNNER_VAR="ZOMBIENET_SDK_DEFAULT_RUNNER_FOR_NATIVE${RUNNER_SUFFIX}"
|
|
SDK_LARGE_RUNNER_VAR="ZOMBIENET_SDK_LARGE_RUNNER_FOR_NATIVE${RUNNER_SUFFIX}"
|
|
echo "ZOMBIENET_SDK_DEFAULT_RUNNER=${!SDK_DEFAULT_RUNNER_VAR}"
|
|
echo "ZOMBIENET_SDK_LARGE_RUNNER=${!SDK_LARGE_RUNNER_VAR}"
|
|
else
|
|
echo "ZOMBIENET_SDK_IMAGE=${ZOMBIENET_SDK_IMAGE_FOR_K8S}"
|
|
# runner size for k8s is not relevant, it "only" spawns pods and runs the test
|
|
echo "ZOMBIENET_SDK_DEFAULT_RUNNER=${ZOMBIENET_SDK_RUNNER_FOR_K8S}"
|
|
echo "ZOMBIENET_SDK_LARGE_RUNNER=${ZOMBIENET_SDK_RUNNER_FOR_K8S}"
|
|
fi
|
|
|
|
# Trick for multline strings: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#example-of-a-multiline-string
|
|
echo 'FLAKY_TESTS<<EOF'
|
|
cat .github/zombienet-flaky-tests | sed 's/:[0-9]*$//'
|
|
echo EOF
|
|
|
|
# global img from ci
|
|
cat .github/env
|
|
} >> $GITHUB_OUTPUT
|
|
|
|
cat .github/zombienet-env
|
|
cat .github/env
|
|
echo "FLAKY_TESTS:"
|
|
cat .github/zombienet-flaky-tests
|
|
|
|
#
|
|
#
|
|
#
|
|
- name: Set docker images version
|
|
id: set_images_version
|
|
shell: bash
|
|
run: |
|
|
export DOCKER_IMAGES_VERSION=${{ github.event.pull_request.head.sha }}
|
|
if [[ ${{ github.event_name }} == "merge_group" || ${{ github.event_name }} == "workflow_dispatch" || ${{ github.event_name }} == "push" ]]; then
|
|
export DOCKER_IMAGES_VERSION="${GITHUB_SHA}";
|
|
fi
|
|
echo "DOCKER_IMAGES_VERSION=${DOCKER_IMAGES_VERSION}" >> $GITHUB_OUTPUT
|
|
|
|
- name: log
|
|
shell: bash
|
|
run: |
|
|
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
|
|
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
|
|
echo "CI_IMAGE: ${{ steps.set_vars.outputs.IMAGE }}"
|
|
echo "ZOMBIENET_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_IMAGE }}"
|
|
echo "ZOMBIENET_SDK_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_IMAGE }}"
|
|
|
|
- name: Generate test matrix
|
|
id: generate_test_matrix
|
|
shell: bash
|
|
env:
|
|
TESTS_YAML: ${{ inputs.tests_yaml }}
|
|
TEST_PATTERN: ${{ inputs.test_pattern || '' }}
|
|
run: |
|
|
python3 .github/scripts/parse-zombienet-tests.py \
|
|
--matrix ${TESTS_YAML} \
|
|
--flaky-tests "${{ steps.set_vars.outputs.FLAKY_TESTS }}" \
|
|
--test-pattern "${TEST_PATTERN}" > matrix.json
|
|
echo "TEST_MATRIX=$(cat matrix.json)" >> $GITHUB_OUTPUT
|
|
echo "TEST_MATRIX:"
|
|
cat matrix.json | jq '.'
|