Skip to content

Commit

Permalink
feat: add a GitHub action to lint the YAML files
Browse files Browse the repository at this point in the history
Lint some YAML
Add a `.yamllint` config file
  • Loading branch information
jbampton authored and xiaoxiang781216 committed Dec 15, 2020
1 parent 32bf92c commit ca6b11b
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
58 changes: 29 additions & 29 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

extends: default

rules:
document-start: disable
line-length: disable
truthy: disable

0 comments on commit ca6b11b

Please sign in to comment.