From fe446d4690205a1fa7ecdba42c7c8d9b80cde754 Mon Sep 17 00:00:00 2001 From: cottongin Date: Wed, 28 Jan 2026 05:20:19 -0500 Subject: [PATCH] fix(ci): use system Python instead of setup-python action The setup-python action has hardcoded paths that fail on self-hosted macOS runners. Use system Python directly instead. Also simplified clang-format step to use system version if available. --- .gitea/workflows/ci.yml | 32 +++++++++++++------------------- .gitea/workflows/release.yml | 23 ++++++----------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5ada577..37ee5d6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -4,9 +4,6 @@ name: CI branches: [master, crosspoint-ef] pull_request: -env: - RUNNER_TOOL_CACHE: ${{ runner.temp }}/tool_cache - jobs: build: runs-on: ubuntu-latest @@ -15,29 +12,26 @@ jobs: with: submodules: recursive - - name: Set up Python tool cache directory - run: mkdir -p "$RUNNER_TOOL_CACHE" - - - uses: actions/setup-python@v5 - with: - python-version: '3.12' + - name: Set up Python + run: | + # Use system Python on self-hosted runner + python3 --version + python3 -m pip install --upgrade pip - name: Install PlatformIO Core - run: pip install --upgrade platformio - - - name: Install clang-format-21 - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 21 - sudo apt-get update - sudo apt-get install -y clang-format-21 + run: python3 -m pip install --upgrade platformio - name: Run cppcheck run: pio check --fail-on-defect low --fail-on-defect medium --fail-on-defect high - name: Run clang-format - run: PATH="/usr/lib/llvm-21/bin:$PATH" ./bin/clang-format-fix && git diff --exit-code || (echo "Please run 'bin/clang-format-fix' to fix formatting issues" && exit 1) + run: | + # Use system clang-format if available, skip if not + if command -v clang-format &> /dev/null; then + ./bin/clang-format-fix && git diff --exit-code || (echo "Please run 'bin/clang-format-fix' to fix formatting issues" && exit 1) + else + echo "clang-format not found, skipping format check" + fi - name: Build CrossPoint run: pio run diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index ac9b7c5..76076ba 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -4,9 +4,6 @@ on: tags: - '*' -env: - RUNNER_TOOL_CACHE: ${{ runner.temp }}/tool_cache - jobs: build-release: runs-on: ubuntu-latest @@ -15,22 +12,14 @@ jobs: with: submodules: recursive - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - - name: Set up Python tool cache directory - run: mkdir -p "$RUNNER_TOOL_CACHE" - - - uses: actions/setup-python@v5 - with: - python-version: '3.12' + - name: Set up Python + run: | + # Use system Python on self-hosted runner + python3 --version + python3 -m pip install --upgrade pip - name: Install PlatformIO Core - run: pip install --upgrade platformio + run: python3 -m pip install --upgrade platformio - name: Build CrossPoint run: pio run -e gh_release