Skip to content

Commit

Permalink
chore: refactor QA GitHub Worfklow
Browse files Browse the repository at this point in the history
Signed-off-by: Kristina Devochko <[email protected]>
  • Loading branch information
guidemetothemoon committed Nov 10, 2023
1 parent c5f25f7 commit 1fbe50f
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 103 deletions.
63 changes: 41 additions & 22 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
---
name: Check
name: Quality Checks

on:
pull_request:
workflow_dispatch:

jobs:
Setup:
check-modified-files:
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v3
- name: Setup
run: make setup
- uses: actions/checkout@v4
with:
fetch-depth: 0

Markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run check:markdown
- uses: tj-actions/changed-files@v39
id: changed-files
with:
files: '**/*.md'
separator: ','

Spelling:
run-quality-checks:
runs-on: ubuntu-latest
needs: Setup
needs: check-modified-files
if: needs.check-modified-files.outputs.any_changed == 'true'
steps:
- uses: actions/checkout@v3
- name: Spelling
run: make spelling
- name: Lint Markdown files
uses: DavidAnson/[email protected]
with:
globs: ${{ needs.check-modified-files.outputs.all_changed_files }}
separator: ','
config: '.markdownlint.jsonc'
fix: true
continue-on-error: false

Links:
runs-on: ubuntu-latest
needs: Setup
steps:
- uses: actions/checkout@v3
- name: Links
run: make links
- name: Validate spelling
uses: streetsidesoftware/[email protected]
with:
config: '.'
files: '**/*.md'
inline: 'error'
strict: true
incremental_files_only: true # Limit the files checked to the ones in the pull request or push.

- name: Validate links in Markdown files
uses: gaurav-nelson/[email protected]
with:
check-modified-files-only: true
config-file: 'link-config.json'
base-branch: 'main'
file-extension: '.md'
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions checks/links.sh

This file was deleted.

6 changes: 0 additions & 6 deletions checks/setup.sh

This file was deleted.

5 changes: 0 additions & 5 deletions checks/spelling.sh

This file was deleted.

23 changes: 0 additions & 23 deletions docker-compose.yml

This file was deleted.

File renamed without changes.
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@
"build:production": "npm run cd:site build:production",
"build": "npm run cd:site build",
"cd:site": "npm run _cd:site -- npm run",
"check:links:internal": "npm run cd:site check:links:internal",
"check:links": "npm run cd:site check:links",
"check:markdown": "npx markdownlint '*.md' '*/*.md' website/content",
"fix:markdown": "npm run check:markdown -- --fix",
"get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
"precheck:markdown": "npm list markdownlint-cli || npm install markdownlint-cli",
"prepare": "npm run site-install",
"prepare": "npm run site-install && husky install",
"serve:dev": "npm run cd:site serve:dev",
"serve": "npm run cd:site serve",
"site-install": "npm run _cd:site -- npm install",
"test": "npm run cd:site test"
},
"devDependencies": {
"cspell": "^6.31.3",
"htmltest-bin": "github:chalin/htmltest-bin#semver:0.17.0",
"markdown-link-check": "^3.11.2",
"markdownlint-cli": "^0.35.0",
"husky": "^8.0.3",
"prettier": "^3.0.1"
},
"enginesComment": "Ensure that engines.node value stays consistent with the project's .nvmrc",
Expand Down

0 comments on commit 1fbe50f

Please sign in to comment.