From e8e9a3c9bd08f2712a28f610244c5830d73163ad Mon Sep 17 00:00:00 2001 From: Ashen Chathuranga Date: Sun, 8 Dec 2024 18:51:31 +0530 Subject: [PATCH] ahanna epa --- action.py | 2 +- entrypoint.sh | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/action.py b/action.py index 1c0a422..84fcc89 100644 --- a/action.py +++ b/action.py @@ -56,7 +56,7 @@ def validate_dependencies(): def validate_code_style(): try: result = subprocess.run( - ["arduino-cli", "lint"], + ["arduino-cli", "arduino-lint"], capture_output=True, text=True, check=True diff --git a/entrypoint.sh b/entrypoint.sh index a3374f6..03839f8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,22 +18,18 @@ PR_TITLE=$(jq --raw-output .pull_request.title $GITHUB_EVENT_PATH) PR_VERSION=$(grep '^version=' library.properties | cut -d'=' -f2) MAIN_VERSION=$(git fetch origin main && git checkout origin/main -- library.properties && grep '^version=' library.properties | cut -d'=' -f2) -# Install arduino-cli manually if not already installed -if ! command -v arduino-cli &> /dev/null; then - echo "Installing latest arduino-cli..." - - # Set the installation directory - INSTALL_DIR="/github/workspace/bin" - mkdir -p "$INSTALL_DIR" - - # Download and install the latest version of Arduino CLI - curl -fsSL https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz | tar -xz -C "$INSTALL_DIR" - - # Add to PATH - export PATH="$INSTALL_DIR:$PATH" - echo "arduino-cli installed successfully at $INSTALL_DIR" +# Install arduino-cli manually +if ! command -v arduino-cli &> /dev/null +then + echo "arduino-cli not found, installing..." + + # Download the Arduino CLI binary + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh + + # Move to a directory in PATH + mv bin/arduino-cli /usr/local/bin/ else - echo "arduino-cli already installed." + echo "arduino-cli already installed" fi # Export variables for Python script