Skip to content

Fix #13: Skip canonical and alternate links in external link validation #45

Fix #13: Skip canonical and alternate links in external link validation

Fix #13: Skip canonical and alternate links in external link validation #45

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x] # All versions that are "active", "current" or "maintenance" support by Node.js
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Check code formatting
run: yarn format:check
- name: Run type checking
run: yarn lint
- name: Run tests with coverage
run: yarn test:coverage
- name: Build package
run: yarn build
# Test package installation and imports
package-test:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install dependencies and build
run: |
yarn install --immutable
yarn build
- name: Pack package
run: |
yarn pack
echo "Package files created:"
ls -la *.tgz
- name: Test ESM import
run: |
# Create test dir in /tmp to avoid yarn workspace conflicts
cd /tmp
mkdir -p test-esm && cd test-esm
# Create simple package.json
cat > package.json << 'JSON'
{ "type": "module" }
JSON
npm init -y > /dev/null
# Install the packed tarball - yarn pack always creates package.tgz
npm install "${{ github.workspace }}/package.tgz"
# Create test script
cat > test.mjs << 'JS'
import plugin from '@fulldecent/nice-checkers-plugin';
console.log('✅ ESM import successful');
console.log('Plugin name:', plugin.name);
console.log('Plugin rules:', Object.keys(plugin.rules || {}));
console.log('Plugin configs:', Object.keys(plugin.configs || {}));
JS
node test.mjs
- name: Test CJS require
run: |
cd /tmp
mkdir -p test-cjs && cd test-cjs
npm init -y > /dev/null
npm install "${{ github.workspace }}/package.tgz"
cat > test.cjs << 'JS'
const plugin = require('@fulldecent/nice-checkers-plugin');
console.log('✅ CJS require successful');
// CJS might require accessing the default export
const actualPlugin = plugin.default || plugin;
console.log('Plugin name:', actualPlugin.name);
console.log('Plugin rules:', Object.keys(actualPlugin.rules || {}));
console.log('Plugin configs:', Object.keys(actualPlugin.configs || {}));
JS
node test.cjs