From 8a705abb414443b1f7c68769369a253122fa6864 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Jun 2025 00:30:42 +0930 Subject: [PATCH] ci: Add initial CI for PRs ref: #5 #2 --- .github/workflows/ci.yaml | 26 ++++++++++ .github/workflows/pull_request.yaml | 26 ++++++++++ .vscode/settings.json | 35 +++++++++++++ .yamllint | 76 +++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/pull_request.yaml create mode 100644 .vscode/settings.json create mode 100644 .yamllint diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f3ff358 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,26 @@ +--- + +name: Pull Requests + + +on: + pull_request: {} + + +jobs: + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML files + run: yamllint ${PWD}/ + + + pull-request: + name: pull-request + uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..f3ff358 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,26 @@ +--- + +name: Pull Requests + + +on: + pull_request: {} + + +jobs: + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML files + run: yamllint ${PWD}/ + + + pull-request: + name: pull-request + uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..01b1f47 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,35 @@ +{ + "linter.linters": { + "yamllint": { + "capabilities": [ + "ignore-line" + ], + "command": [ + "yamllint", + "--format", + "parsable", + [ + "$config", + "--config-file", + "$config" + ], + "-" + ], + "configFiles": [ + ".yamllint.yml", + ".yamllint.yaml", + ".yamllint" + ], + "enabled": true, + "languages": [ + "yaml" + ], + "name": "yamllint", + "url": "https://github.com/adrienverge/yamllint" + } + }, + "editor.detectIndentation": false, + "editor.indentSize": "tabSize", + "editor.tabSize": 2, + "files.eol": "\n" +} \ No newline at end of file diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..4e0fa48 --- /dev/null +++ b/.yamllint @@ -0,0 +1,76 @@ +--- + +# extends: default + + +ignore: + - '.github/' + - '**/crd/**' + - '*PrometheusRule*' + - '**/source/**' + +rules: + braces: + level: error + max-spaces-inside: 1 + min-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + brackets: + level: error + max-spaces-inside: 1 + min-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + colons: + level: warning + max-spaces-after: 1 + + commas: + level: warning + + comments: + level: error + require-starting-space: true + ignore-shebangs: true + min-spaces-from-content: 4 + + comments-indentation: + level: error + + document-end: + level: error + present: false + + document-start: + level: error + present: true + + empty-lines: + level: error + max: 3 + max-start: 0 + max-end: 0 + + hyphens: + level: error + max-spaces-after: 1 + + indentation: + level: error + spaces: 2 + indent-sequences: true + check-multi-line-strings: true + + line-length: + level: warning + max: 100 + allow-non-breakable-inline-mappings: true + + new-lines: + level: error + type: unix + + truthy: disable