From 1eb02a7ffb5c605880d57ed333f0146f8958d387 Mon Sep 17 00:00:00 2001 From: Alexander Grabowski Date: Mon, 8 Sep 2025 15:18:15 +0700 Subject: [PATCH] Update .gitea/workflows/kibot.yml --- .gitea/workflows/kibot.yml | 53 ++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/kibot.yml b/.gitea/workflows/kibot.yml index b2f31b3..d6fd1ea 100644 --- a/.gitea/workflows/kibot.yml +++ b/.gitea/workflows/kibot.yml @@ -181,11 +181,23 @@ jobs: if: steps.config_check.outputs.found == 'true' run: | cd "${{ steps.find_project.outputs.project_dir }}" - CONFIG_PATH="../${{ steps.config_check.outputs.config_path }}" - CONFIG_PATH=$(realpath "$CONFIG_PATH") + CONFIG_PATH="${{ steps.config_check.outputs.config_path }}" + + # Convert to absolute path if needed + if [[ "$CONFIG_PATH" != /* ]]; then + CONFIG_PATH="$(pwd)/$CONFIG_PATH" + fi + + # Normalize the path + CONFIG_PATH=$(readlink -f "$CONFIG_PATH" 2>/dev/null || realpath "$CONFIG_PATH" 2>/dev/null || echo "$CONFIG_PATH") + + if [ ! -f "$CONFIG_PATH" ]; then + echo "Warning: Config file not found at $CONFIG_PATH" + exit 0 + fi if [ -n "${{ steps.find_project.outputs.sch_file }}" ]; then - echo "Running ERC on schematic files..." + echo "Running ERC with config: $CONFIG_PATH" kibot -c "$CONFIG_PATH" -s run_erc -v || true else echo "No schematic files found, skipping ERC" @@ -196,10 +208,22 @@ jobs: if: steps.config_check.outputs.found == 'true' run: | cd "${{ steps.find_project.outputs.project_dir }}" - CONFIG_PATH="../${{ steps.config_check.outputs.config_path }}" - CONFIG_PATH=$(realpath "$CONFIG_PATH") + CONFIG_PATH="${{ steps.config_check.outputs.config_path }}" - echo "Running DRC on PCB..." + # Convert to absolute path if needed + if [[ "$CONFIG_PATH" != /* ]]; then + CONFIG_PATH="$(pwd)/$CONFIG_PATH" + fi + + # Normalize the path + CONFIG_PATH=$(readlink -f "$CONFIG_PATH" 2>/dev/null || realpath "$CONFIG_PATH" 2>/dev/null || echo "$CONFIG_PATH") + + if [ ! -f "$CONFIG_PATH" ]; then + echo "Warning: Config file not found at $CONFIG_PATH" + exit 0 + fi + + echo "Running DRC with config: $CONFIG_PATH" kibot -c "$CONFIG_PATH" -s run_drc -v || true continue-on-error: true @@ -207,11 +231,24 @@ jobs: if: steps.config_check.outputs.found == 'true' run: | cd "${{ steps.find_project.outputs.project_dir }}" - CONFIG_PATH="../${{ steps.config_check.outputs.config_path }}" - CONFIG_PATH=$(realpath "$CONFIG_PATH") + CONFIG_PATH="${{ steps.config_check.outputs.config_path }}" + + # Convert to absolute path if needed + if [[ "$CONFIG_PATH" != /* ]]; then + CONFIG_PATH="$(pwd)/$CONFIG_PATH" + fi + + # Normalize the path + CONFIG_PATH=$(readlink -f "$CONFIG_PATH" 2>/dev/null || realpath "$CONFIG_PATH" 2>/dev/null || echo "$CONFIG_PATH") + + if [ ! -f "$CONFIG_PATH" ]; then + echo "Error: Config file not found at $CONFIG_PATH" + exit 1 + fi echo "Generating outputs for ${{ steps.layers.outputs.layers }} layer board" echo "Project: ${{ steps.find_project.outputs.project_name }}" + echo "Using config: $CONFIG_PATH" # Run KiBot with the configuration kibot -c "$CONFIG_PATH" -d Fabrication -v