From 78e7668f58dc3bcefae9a9cd587761ec712379ea Mon Sep 17 00:00:00 2001 From: trns1997 <17682846+trns1997@users.noreply.github.com> Date: Sun, 12 Oct 2025 08:58:11 +0200 Subject: [PATCH] Revert "ci: Serialize CI jobs to avoid unnecessary pipeline execution" This reverts commit cb1b1863c06097d8d8e51961a93c60966064a85a. Signed-off-by: trns1997 --- .github/workflows/{ci.yml => build.yml} | 86 +++---------------------- .github/workflows/check.yml | 49 ++++++++++++++ .github/workflows/lint.yml | 34 ++++++++++ 3 files changed, 91 insertions(+), 78 deletions(-) rename .github/workflows/{ci.yml => build.yml} (85%) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 85% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 9f5e18d6e82..dce9cd5d756 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -name: CI Pipeline +name: Build on: pull_request: @@ -34,83 +34,13 @@ permissions: contents: read concurrency: - group: ci-${{ github.event.pull_request.number || github.ref }} + group: build-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - # --- Draft guard --- - draft-check: - runs-on: ubuntu-latest - outputs: - skip: ${{ steps.check.outputs.skip }} - steps: - - id: check - run: | - if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.pull_request.draft }}" = "true" ]; then - echo "Draft PR detected — skipping pipeline." - echo "skip=true" >> $GITHUB_OUTPUT - else - echo "PR is ready or push event — continuing pipeline." - echo "skip=false" >> $GITHUB_OUTPUT - fi - # --- Check job --- - check: - needs: draft-check - if: ${{ needs.draft-check.outputs.skip != 'true' }} - runs-on: ubuntu-latest - - steps: - - name: Checkout nuttx repo - uses: actions/checkout@v5 - with: - repository: apache/nuttx - path: nuttx - fetch-depth: 0 - - - name: Check Pull Request - run: | - echo "::add-matcher::nuttx/.github/nxstyle.json" - python3 -m venv .venv - source .venv/bin/activate - pip install codespell cmake-format black isort flake8 cvt2utf - cd nuttx - commits="${{ github.event.pull_request.base.sha }}..HEAD" - git log --oneline $commits - echo "../nuttx/tools/checkpatch.sh -c -u -m -g $commits" - ../nuttx/tools/checkpatch.sh -c -u -m -g $commits - - # --- Lint job --- - lint: - needs: check - runs-on: ubuntu-latest - permissions: - contents: read - statuses: write - - steps: - - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - run: mkdir super-linter.report - - - name: Lint - uses: github/super-linter@v7 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_ALL_CODEBASE: false - VALIDATE_PYTHON_BLACK: true - VALIDATE_PYTHON_FLAKE8: true - PYTHON_FLAKE8_CONFIG_FILE: setup.cfg - VALIDATE_PYTHON_ISORT: true - PYTHON_ISORT_CONFIG_FILE: setup.cfg - VALIDATE_YAML: true - - # --- Build job --- # Fetch the source from nuttx and nuttx-apps repos Fetch-Source: - needs: lint runs-on: ubuntu-latest steps: - name: Determine Target Branches @@ -194,8 +124,8 @@ jobs: # Select the Linux Builds based on PR Arch Label Linux-Arch: - needs: Fetch-Source uses: apache/nuttx/.github/workflows/arch.yml@master + needs: Fetch-Source with: os: Linux boards: | @@ -318,8 +248,8 @@ jobs: # Select the macOS Builds based on PR Arch Label macOS-Arch: - needs: Fetch-Source uses: apache/nuttx/.github/workflows/arch.yml@master + needs: Fetch-Source with: os: macOS boards: | @@ -327,10 +257,10 @@ jobs: # Run the selected macOS Builds macOS: - needs: macOS-Arch - runs-on: macos-13 permissions: contents: none + runs-on: macos-13 + needs: macOS-Arch if: ${{ needs.macOS-Arch.outputs.skip_all_builds != '1' }} strategy: max-parallel: 2 @@ -378,8 +308,8 @@ jobs: # Select the msys2 Builds based on PR Arch Label msys2-Arch: - needs: Fetch-Source uses: apache/nuttx/.github/workflows/arch.yml@master + needs: Fetch-Source with: os: msys2 boards: | @@ -460,8 +390,8 @@ jobs: # Select the msvc Builds based on PR Arch Label msvc-Arch: - needs: Fetch-Source uses: apache/nuttx/.github/workflows/arch.yml@master + needs: Fetch-Source with: os: msvc boards: | diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000000..b7ff183a7be --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,49 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: Check + +on: + pull_request: + paths-ignore: + - 'Documentation/**' + +concurrency: + group: check-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout nuttx repo + uses: actions/checkout@v5 + with: + repository: apache/nuttx + path: nuttx + fetch-depth: 0 + + - name: Check Pull Request + run: | + echo "::add-matcher::nuttx/.github/nxstyle.json" + python3 -m venv .venv + source .venv/bin/activate + pip install codespell cmake-format black isort flake8 cvt2utf + cd nuttx + commits="${{ github.event.pull_request.base.sha }}..HEAD" + git log --oneline $commits + echo "../nuttx/tools/checkpatch.sh -c -u -m -g $commits" + ../nuttx/tools/checkpatch.sh -c -u -m -g $commits diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..33e042803d8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,34 @@ +name: Lint + +on: [pull_request] + +concurrency: + group: lint-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + lint: + permissions: + contents: read # for actions/checkout to fetch code + statuses: write # for github/super-linter to mark status of each linter run + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - run: mkdir super-linter.report + - name: Lint + uses: github/super-linter@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + VALIDATE_PYTHON_BLACK: true + VALIDATE_PYTHON_FLAKE8: true + PYTHON_FLAKE8_CONFIG_FILE: setup.cfg + VALIDATE_PYTHON_ISORT: true + PYTHON_ISORT_CONFIG_FILE: setup.cfg + VALIDATE_YAML: true