Skip to content

feat: add skill set chart shortcode #155

feat: add skill set chart shortcode

feat: add skill set chart shortcode #155

Workflow file for this run

name: CI
on:
pull_request:
branches: ["**"]
jobs:
changes:
name: Detect Changed File Types
runs-on: ubuntu-latest
outputs:
e2e_required: ${{ steps.decide.outputs.e2e_required }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect docs-only changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
docs:
- 'README.md'
- 'docs/**'
- '.github/**/*.md'
non_docs:
- '**'
- '!README.md'
- '!docs/**'
- '!.github/**/*.md'
- name: Decide whether E2E is required
id: decide
run: |
if [[ "${{ steps.filter.outputs.docs }}" == "true" && "${{ steps.filter.outputs.non_docs }}" != "true" ]]; then
echo "e2e_required=false" >> "$GITHUB_OUTPUT"
else
echo "e2e_required=true" >> "$GITHUB_OUTPUT"
fi
test:
name: Test & Build
runs-on: ubuntu-latest
needs: changes
env:
HUGO_VERSION: 0.160.0
DART_SASS_VERSION: 1.97.3
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.1
cache: npm
- name: Install dependencies
run: npm ci
- name: Run all tests
if: ${{ needs.changes.outputs.e2e_required == 'true' }}
run: npm test
- name: Create directory for user-specific executable files
run: mkdir -p "${HOME}/.local"
- name: Install Dart Sass
run: |
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
- name: Install Hugo
run: |
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
mkdir "${HOME}/.local/hugo"
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
echo "Hugo: $(hugo version)"
- name: Hugo production build
run: cd exampleSite && hugo --gc --minify
- name: Validate Algolia JSON outputs
run: |
set -e
cd exampleSite
# Default language JSON (root) must exist and be non-empty
count=$(jq 'length' public/algolia.json)
if [ "$count" -eq 0 ]; then
echo "ERROR: public/algolia.json is empty"
exit 1
fi
echo "public/algolia.json: $count records OK"
# Secondary language JSON must exist and be non-empty
# NOTE: path 'public/en/' is tied to exampleSite's language config.
# Update this path if exampleSite languages change.
count=$(jq 'length' public/en/algolia.json)
if [ "$count" -eq 0 ]; then
echo "ERROR: public/en/algolia.json is empty"
exit 1
fi
echo "public/en/algolia.json: $count records OK"
# Default language JSON must not contain secondary language permalinks
if jq -e '[.[] | .permalink | contains("/en/")] | any' public/algolia.json > /dev/null; then
echo "ERROR: public/algolia.json contains /en/ permalinks (cross-language contamination)"
exit 1
fi
echo "public/algolia.json: no cross-language contamination OK"
# Secondary language JSON must only contain its own language permalinks
if jq -e '[.[] | .permalink | contains("/en/")] | all | not' public/en/algolia.json > /dev/null; then
echo "ERROR: public/en/algolia.json contains non-English permalinks"
exit 1
fi
echo "public/en/algolia.json: all records are English OK"
e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: [changes, test]
if: ${{ needs.changes.outputs.e2e_required == 'true' }}
env:
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.1
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Install Hugo and Dart Sass
env:
HUGO_VERSION: 0.160.0
DART_SASS_VERSION: 1.97.3
run: |
mkdir -p "${HOME}/.local"
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
mkdir "${HOME}/.local/hugo"
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
- name: Run E2E tests
run: npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7