diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..093b4c9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.patch] +insert_final_newline = false + +[*.md,*.patch] +trim_trailing_whitespace = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af9846c..e987642 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,23 +1,41 @@ name: ci on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: + lint: + runs-on: 'ubuntu-22.04' + steps: + - name: 'Get Changed Files' + id: 'files' + uses: 'masesgroup/retrieve-changed-files@v2' + with: + format: 'json' + - name: Check out code. + uses: actions/checkout@v2 + - name: 'Check EditorConfig Lint' + run: | + sudo apt install -y jq golang + go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest' + + readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')" + ~/go/bin/editorconfig-checker ${changed_files[@]} + build: strategy: fail-fast: false matrix: platform: - - ubuntu-18.04 + - ubuntu-22.04 - macos-latest runs-on: ${{ matrix.platform }} steps: - name: Check out code. uses: actions/checkout@v2 - name: Linux Install - if: matrix.platform == 'ubuntu-18.04' + if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get install -y bsdmainutils - name: Script