From 6c029043cbb4dd41ad12210eab4663832a75ee8a Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Sat, 13 Jan 2024 07:07:23 -0500 Subject: [PATCH] [CI] Run `npm test` --- .gitattributes | 3 +++ .github/workflows/smoke.yaml | 4 ++-- .github/workflows/test.yaml | 25 +++++++++++++++++++++++++ .prettierignore | 1 + package.json | 3 ++- tools/make-site.sh | 2 +- 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/test.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..8e486f6180 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.cmd text eol=crlf +*.bat text eol=crlf diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index fb0e71062a..77a3f6ebf2 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -2,10 +2,10 @@ name: smoke on: push: - branches: [ main ] + branches: [main] pull_request: schedule: # midnight every day - - cron: '0 0 * * *' + - cron: '0 0 * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000..5205b31d93 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +name: test + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: '11 0 * * *' # 11 past midnight every day + workflow_dispatch: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: package.json + - run: npm install --omit=optional + - run: npm test diff --git a/.prettierignore b/.prettierignore index 54ed1b8a29..f112941105 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ .editorconfig +.gitattributes .gitignore .nvmrc .prettierignore diff --git a/package.json b/package.json index b42f1b85bd..1404a8a93d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "cd:docs": "npm run _cd:docs -- npm run", "check": "npm run check:format && npm run check:links--md", "check:format": "npm run _check:format || (echo '[help] Run: npm run fix:format'; exit 1)", - "check:links--md": "npx markdown-link-check --config .markdown-link-check.json *.md", + "check:links--md": "ls *.md | xargs npx markdown-link-check --config .markdown-link-check.json", "check:links:all": "npm run cd:docs check:links:all", "check:links": "npm run cd:docs check:links", "docs-install": "npm run _cd:docs -- npm install", @@ -31,6 +31,7 @@ "pretest": "npm run _prebuild", "serve": "npm run cd:docs serve", "test": "npm run cd:docs test && npm run check", + "test-windows": "npm run cd:docs test", "update:pkg:dep": "npm install --save-exact @fortawesome/fontawesome-free@latest bootstrap@latest", "update:pkg:hugo": "npm install --save-exact -D hugo-extended@latest" }, diff --git a/tools/make-site.sh b/tools/make-site.sh index c6911ad225..30ac261282 100755 --- a/tools/make-site.sh +++ b/tools/make-site.sh @@ -88,4 +88,4 @@ $HUGO set +x -echo "[INFO] $SITE_NAME has been successfully created, set up, and built." +echo "[INFO] $SITE_NAME successfully created, set up, and built."