You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/12/15 15:52:11 UTC

[incubator-nuttx] branch master updated: feat: add a GitHub action to lint the YAML files

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ca6b11b  feat: add a GitHub action to lint the YAML files
ca6b11b is described below

commit ca6b11b4254e239b8925c9fb1d14303c0c373e37
Author: John Bampton <jb...@gmail.com>
AuthorDate: Tue Dec 15 11:01:37 2020 +1000

    feat: add a GitHub action to lint the YAML files
    
    Lint some YAML
    Add a `.yamllint` config file
---
 .asf.yaml                   |  6 ++---
 .github/workflows/build.yml |  4 ++--
 .github/workflows/check.yml | 28 +++++++++++-----------
 .github/workflows/doc.yml   | 58 ++++++++++++++++++++++-----------------------
 .github/workflows/lint.yml  | 12 ++++++++++
 .yamllint                   |  8 +++++++
 6 files changed, 68 insertions(+), 48 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index c1200bb..c71e570 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -15,8 +15,8 @@ github:
     - microcontroller
   enabled_merge_buttons:
     # disable squash button:
-    squash:  false
+    squash: false
     # disable merge button:
-    merge:   false
+    merge: false
     # enable rebase button:
-    rebase:  true
+    rebase: true
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9e27f42..ce5ce76 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -150,7 +150,7 @@ jobs:
           command: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux
 
       - name: Export NuttX Repo SHA
-        run:  echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
+        run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
       - name: Run builds
         uses: ./sources/testing/.github/actions/ci-container
         env:
@@ -193,7 +193,7 @@ jobs:
           key: ${{ runner.os }}-tools-${{ hashFiles('./sources/testing/cibuild.sh') }}
 
       - name: Export NuttX Repo SHA
-        run:  echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
+        run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
       - name: Run Builds
         run: |
           echo "::add-matcher::sources/nuttx/.github/gcc.json"
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 53221ed..387af54 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -22,18 +22,18 @@ jobs:
     runs-on: ubuntu-18.04
 
     steps:
-    - name: Checkout nuttx repo
-      uses: actions/checkout@v2
-      with:
-        repository: apache/incubator-nuttx
-        path: nuttx
-        fetch-depth: 0
+      - name: Checkout nuttx repo
+        uses: actions/checkout@v2
+        with:
+          repository: apache/incubator-nuttx
+          path: nuttx
+          fetch-depth: 0
 
-    - name: Check Pull Request
-      run: |
-        echo "::add-matcher::nuttx/.github/nxstyle.json"
-        cd nuttx
-        commits="${{ github.event.pull_request.base.sha }}..HEAD"
-        git log --oneline $commits
-        echo "../nuttx/tools/checkpatch.sh -g $commits"
-        ../nuttx/tools/checkpatch.sh -g $commits
+      - name: Check Pull Request
+        run: |
+          echo "::add-matcher::nuttx/.github/nxstyle.json"
+          cd nuttx
+          commits="${{ github.event.pull_request.base.sha }}..HEAD"
+          git log --oneline $commits
+          echo "../nuttx/tools/checkpatch.sh -g $commits"
+          ../nuttx/tools/checkpatch.sh -g $commits
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 5c3b661..a3dbf2f 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -19,35 +19,35 @@ jobs:
   build-html:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v1
-    - uses: actions/setup-python@v2
-      with:
-        python-version: '3.8'
-    - name: Generate requirements.txt file
-      run: |
-        cd Documentation/
-        pip3 install pipenv
-        pipenv lock -r > requirements.txt
-    - uses: ammaraskar/sphinx-problem-matcher@master
-    - uses: ammaraskar/sphinx-action@master
-      with:
-        docs-folder: "Documentation/"
-    - uses: actions/upload-artifact@v2
-      with:
-        name: sphinx-docs
-        path: Documentation/_build/html/
+      - uses: actions/checkout@v1
+      - uses: actions/setup-python@v2
+        with:
+          python-version: '3.8'
+      - name: Generate requirements.txt file
+        run: |
+          cd Documentation/
+          pip3 install pipenv
+          pipenv lock -r > requirements.txt
+      - uses: ammaraskar/sphinx-problem-matcher@master
+      - uses: ammaraskar/sphinx-action@master
+        with:
+          docs-folder: "Documentation/"
+      - uses: actions/upload-artifact@v2
+        with:
+          name: sphinx-docs
+          path: Documentation/_build/html/
   linkcheck:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v1
-    - uses: actions/setup-python@v2
-      with:
-        python-version: '3.8'
-    - uses: ammaraskar/sphinx-problem-matcher@master
-    - name: Run linkcheck
-      run: |
-        cd Documentation/
-        pip3 install pipenv
-        pipenv install
-        # This step flakes frequently so still annotate errors but dont fail the build
-        pipenv run make linkcheck || true
+      - uses: actions/checkout@v1
+      - uses: actions/setup-python@v2
+        with:
+          python-version: '3.8'
+      - uses: ammaraskar/sphinx-problem-matcher@master
+      - name: Run linkcheck
+        run: |
+          cd Documentation/
+          pip3 install pipenv
+          pipenv install
+          # This step flakes frequently so still annotate errors but dont fail the build
+          pipenv run make linkcheck || true
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..b85863d
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,12 @@
+name: ❄️ Lint
+
+on: [pull_request]
+
+jobs:
+  yamllint:
+    name: 🍺 YAML
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: 🧹 YAML Lint
+        uses: ibiqlik/action-yamllint@v3
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..9c4a22a
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,8 @@
+---
+
+extends: default
+
+rules:
+  document-start: disable
+  line-length: disable
+  truthy: disable