mirror of
https://github.com/apache/nuttx.git
synced 2026-03-24 07:35:07 +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
|
||||
# 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: |
|
||||
49
.github/workflows/check.yml
vendored
Normal file
49
.github/workflows/check.yml
vendored
Normal file
@@ -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
|
||||
34
.github/workflows/lint.yml
vendored
Normal file
34
.github/workflows/lint.yml
vendored
Normal file
@@ -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