From a547f27f2181c821d09b1caf5a47414c03c4759f Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Sat, 11 Jul 2020 13:41:31 +0200 Subject: [PATCH] New GitHub Action to lint code style --- .github/workflows/lint-code.yml | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/lint-code.yml diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml new file mode 100644 index 00000000..df26d0b0 --- /dev/null +++ b/.github/workflows/lint-code.yml @@ -0,0 +1,53 @@ +name: Lint Code +on: [push, pull_request] + +jobs: + Markdown: + name: Test Markdown syntax + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '10' + + - name: Install markdownlint + run: npm install -g markdownlint-cli + + - name: Run Markdownlint + run: markdownlint ${GITHUB_WORKSPACE} -c ${GITHUB_WORKSPACE}/.github/markdownlint.yml + + EditorConfig: + name: Test Editor Config rules + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '10' + + - name: Install ECLint + run: npm install -g eclint + + - name: Run ECLint check + run: eclint check $(git ls-files | grep -v test) + + YAML: + name: Test YAML syntax + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v1 + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: '10' + + - name: Install yaml-lint + run: npm install -g yaml-lint + + - name: Run yaml-lint + run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yaml" -or -name "*.yml")