From 904b891970d54bd3a5e5e821e14f9007da3f4d3a Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 27 May 2024 17:49:20 -0400 Subject: [PATCH] [CI] Run checks over PRs (#235) Signed-off-by: Patrice Chalin --- .cspell.yml | 6 ++++-- .github/workflows/format-check.yml | 18 ++++++++++++++++++ .github/workflows/link-check.yml | 18 ++++++++++++++++++ .github/workflows/spell-check.yml | 18 ++++++++++++++++++ .nvmrc | 1 + .prettierignore | 2 ++ package.json | 3 +++ 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/format-check.yml create mode 100644 .github/workflows/link-check.yml create mode 100644 .github/workflows/spell-check.yml create mode 100644 .nvmrc diff --git a/.cspell.yml b/.cspell.yml index 155326b..2e643c2 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -3,8 +3,10 @@ # https://www.streetsidesoftware.com/vscode-spell-checker/docs/configuration/ version: '0.2' caseSensitive: true -# ignorePaths: -# - '*.svg' +ignorePaths: + # Temporary until https://github.com/cncf/techdocs/pull/229 is merged + - /docs/ + - /assessments/ # patterns: # - name: CodeBlock # pattern: | diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 0000000..160c48e --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,18 @@ +name: Format checks + +on: + pull_request: + +jobs: + format-check: + name: FILE FORMAT + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + + - name: Check file format + run: npm run check:format diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 0000000..d38c987 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,18 @@ +name: Link checks + +on: + pull_request: + +jobs: + link-check: + name: LINK checking + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + + - name: Check file format + run: npm run check:links diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..ce3953b --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,18 @@ +name: Spelling checks + +on: + pull_request: + +jobs: + spelling-check: + name: SPELLING check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + + - name: Check file format + run: npm run check:spelling diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..b009dfb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/.prettierignore b/.prettierignore index 82741e1..0649f64 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,5 +2,7 @@ # temporary +# Until https://github.com/cncf/techdocs/pull/229 is merged assessments docs +/README.md diff --git a/package.json b/package.json index 5d8e718..e5f92db 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "scripts": { "_check:format:any": "npx prettier --check --ignore-path ''", "_check:format": "npx prettier --check .", + "_list:check:*": "npm run --loglevel=warn | grep -Ee '^\\s*check:[^:]+$'", + "_list:fix:*": "npm run --loglevel=warn | grep -Ee '^\\s*fix:[^:]+$' | grep -v 'fix:all'", "check:format": "npm run _check:format || (echo '[help] Run: npm run fix:format'; exit 1)", "check:links": "npx markdown-link-check --config .markdown-link-check.json *.md", "check:spelling": "npx cspell --no-progress -c .cspell.yml .", @@ -22,6 +24,7 @@ "prettier": "^3.2.5" }, "private": true, + "spelling": "cSpell:ignore loglevel -", "prettier": { "proseWrap": "always", "singleQuote": true