From ce3e81b53ca31f8d39aae81455b5154f02d774ef Mon Sep 17 00:00:00 2001 From: utam0k Date: Sun, 16 Jun 2024 15:34:23 +0900 Subject: [PATCH] ci: Add a github actions workflow for lint Signed-off-by: utam0k --- .github/workflows/lint.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..adcab8ec9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +name: Lint + +on: [push, pull_request] + +jobs: + check-format: + runs-on: ubuntu-latest + env: + # We need jq +1.7 because of jqlang/jq#1741. + JQ_VERSION: '1.7' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Replace jq with specified version + run: | + wget -O jq "https://github.com/jqlang/jq/releases/download/jq-${{ env.JQ_VERSION }}/jq-linux-amd64" + chmod +x ./jq + JQ_PATH=$(which jq) + sudo mv jq $JQ_PATH + - name: Check jq version + run: jq --version + + - name: Run make -C schema fmt + run: make -C schema fmt + + - name: Check for changes + run: git diff --exit-code