Skip to content

Build Semantic Search and Chatbot Retrieval Systems with Qdrant on Google Cloud C4A Axion processors #2204

Build Semantic Search and Chatbot Retrieval Systems with Qdrant on Google Cloud C4A Axion processors

Build Semantic Search and Chatbot Retrieval Systems with Qdrant on Google Cloud C4A Axion processors #2204

Workflow file for this run

name: Test Learning Path
on: pull_request
env:
HUGO_VERSION: 0.130.0
jobs:
Test-Pull-Request:
runs-on: ubuntu-24.04-arm
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ steps.vars.outputs.branch-name }}
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: Run hugo command to test site builds
run: |
hugo
- name: Get all changed markdown files
id: changed-markdown-files
uses: tj-actions/changed-files@v46
with:
files: |
content/**/**.md
- name: Check for capital letters or spaces in content directory
run: |
echo "Checking for capital letters or spaces in content directory paths (excluding file extensions)..."
tmpfile=$(mktemp)
git diff --name-only --diff-filter=d origin/${{ github.base_ref }}...HEAD |
grep '^content/' |
while read -r path; do
name=$(basename "$path")
# Strip file extension if it exists
base="${name%.*}"
if [[ "$base" =~ [A-Z] || "$base" =~ [[:space:]] ]]; then
echo "Invalid name: $path"
echo "$path" >> "$tmpfile"
fi
done
if [[ -s "$tmpfile" ]]; then
echo "❌ One or more files or directories in 'content/' contain capital letters or spaces (excluding extensions):"
cat "$tmpfile"
rm "$tmpfile"
exit 1
else
rm "$tmpfile"
echo "✅ No capital letters or spaces found in 'content/' paths."
fi
- name: Install dependencies
if: steps.changed-markdown-files.outputs.any_changed == 'true'
run: pip install -r tools/requirements.txt
- name: Validate _index.md files
if: steps.changed-markdown-files.outputs.any_changed == 'true'
run: |
echo "Checking YAML fields for changed learning paths..."
python3 tools/verify_index_fields.py ${{ steps.changed-markdown-files.outputs.all_changed_files }}
- name: Run test suite for all changed .md files
id: run-suite
if: steps.changed-markdown-files.outputs.any_changed == 'true'
# Run the test suite
run: |
set -o pipefail; ./tools/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt
- name: Parse test suite errors
id: test-suite-state
if: success()
# Catch any missed errors if running multiple tests
run: |
cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "TEST_SUITE_ERRORS=true" >> "$GITHUB_ENV" \
|| echo "TEST_SUITE_ERRORS=false" >> "$GITHUB_ENV"
- name: Check for errors in test suite
if: env.TEST_SUITE_ERRORS == 'true' && success()
run: |
echo "Test failures detected in test suite, check the output in earlier steps"
exit 1
- name: Parse test maintenance off
id: maintenance-state
if: success()
# Check if maintenance is turned off
run: |
cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "MAINTENANCE=off" >> "$GITHUB_ENV" \
|| echo "MAINTENANCE=on" >> "$GITHUB_ENV"
- name: Check if maintenance is turned off
if: env.MAINTENANCE == 'off' && success()
run: echo "Maintenance is turned off for one or more files"