Skip to content

Commit

Permalink
copy TOML configs before executing test binary in compatibility job
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Jan 9, 2024
1 parent c0a3327 commit db3e121
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,54 @@ jobs:
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
binary_name: tests
# We need to provide TOML configs to test execution step, because tests binary doesn't containt them
# and we need these default values if we don't want to create them in flight
- name: Gather TOML config files
run: |
cat << EOF > copy_toml.sh
# This script searches for TOML files matching given regex patterns and copies them to a target directory.
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <pattern-array> <search-folder> <target-folder>"
exit 1
fi
declare -a patterns=($1) # Array of regex filename patterns
search_folder=$2 # Folder to search in
target_folder=$3 # Target folder for copying files
if [ ! -d "$search_folder" ]; then
echo "Search folder does not exist: $search_folder"
exit 1
fi
mkdir -p "$target_folder"
copy_files() {
local pattern=$1
# Find .toml files, extract filenames, and match pattern
find "$search_folder" -type f -name "*.toml" | while read -r file; do
filename=$(basename "$file")
if [[ $filename =~ $pattern ]]; then
cp "$file" "$target_folder"
fi
done
}
for pattern in "${patterns[@]}"; do
copy_files "$pattern"
done
echo "Copy operation completed."
EOF
/bin/sh ./copy_toml.sh ./integration-tests ./toml_configs
cd ./toml_configs && zip toml_configs.zip ./
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: toml_configs
path: toml_configs.zip

# End Build Test Dependencies

Expand Down Expand Up @@ -145,6 +193,12 @@ jobs:
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: tests
- name: Download TOML configs artifact
uses: actions/download-artifact@v3
with:
name: toml_configs
- name: Unzip artifact with TOML configs
run: unzip toml_configs.zip
- name: Prepare Base64 TOML config
env:
SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
Expand Down

0 comments on commit db3e121

Please sign in to comment.