mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Revert "ci: Serialize CI jobs to avoid unnecessary pipeline execution"
This reverts commit cb1b1863c0.
Signed-off-by: trns1997 <trns1997@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
name: CI Pipeline
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -34,83 +34,13 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{ github.event.pull_request.number || github.ref }}
|
group: build-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
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 the source from nuttx and nuttx-apps repos
|
||||||
Fetch-Source:
|
Fetch-Source:
|
||||||
needs: lint
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Determine Target Branches
|
- name: Determine Target Branches
|
||||||
@@ -194,8 +124,8 @@ jobs:
|
|||||||
|
|
||||||
# Select the Linux Builds based on PR Arch Label
|
# Select the Linux Builds based on PR Arch Label
|
||||||
Linux-Arch:
|
Linux-Arch:
|
||||||
needs: Fetch-Source
|
|
||||||
uses: apache/nuttx/.github/workflows/arch.yml@master
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
||||||
|
needs: Fetch-Source
|
||||||
with:
|
with:
|
||||||
os: Linux
|
os: Linux
|
||||||
boards: |
|
boards: |
|
||||||
@@ -318,8 +248,8 @@ jobs:
|
|||||||
|
|
||||||
# Select the macOS Builds based on PR Arch Label
|
# Select the macOS Builds based on PR Arch Label
|
||||||
macOS-Arch:
|
macOS-Arch:
|
||||||
needs: Fetch-Source
|
|
||||||
uses: apache/nuttx/.github/workflows/arch.yml@master
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
||||||
|
needs: Fetch-Source
|
||||||
with:
|
with:
|
||||||
os: macOS
|
os: macOS
|
||||||
boards: |
|
boards: |
|
||||||
@@ -327,10 +257,10 @@ jobs:
|
|||||||
|
|
||||||
# Run the selected macOS Builds
|
# Run the selected macOS Builds
|
||||||
macOS:
|
macOS:
|
||||||
needs: macOS-Arch
|
|
||||||
runs-on: macos-13
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: none
|
contents: none
|
||||||
|
runs-on: macos-13
|
||||||
|
needs: macOS-Arch
|
||||||
if: ${{ needs.macOS-Arch.outputs.skip_all_builds != '1' }}
|
if: ${{ needs.macOS-Arch.outputs.skip_all_builds != '1' }}
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 2
|
max-parallel: 2
|
||||||
@@ -378,8 +308,8 @@ jobs:
|
|||||||
|
|
||||||
# Select the msys2 Builds based on PR Arch Label
|
# Select the msys2 Builds based on PR Arch Label
|
||||||
msys2-Arch:
|
msys2-Arch:
|
||||||
needs: Fetch-Source
|
|
||||||
uses: apache/nuttx/.github/workflows/arch.yml@master
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
||||||
|
needs: Fetch-Source
|
||||||
with:
|
with:
|
||||||
os: msys2
|
os: msys2
|
||||||
boards: |
|
boards: |
|
||||||
@@ -460,8 +390,8 @@ jobs:
|
|||||||
|
|
||||||
# Select the msvc Builds based on PR Arch Label
|
# Select the msvc Builds based on PR Arch Label
|
||||||
msvc-Arch:
|
msvc-Arch:
|
||||||
needs: Fetch-Source
|
|
||||||
uses: apache/nuttx/.github/workflows/arch.yml@master
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
||||||
|
needs: Fetch-Source
|
||||||
with:
|
with:
|
||||||
os: msvc
|
os: msvc
|
||||||
boards: |
|
boards: |
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user