diff --git a/.github/workflows/test-site.yml b/.github/workflows/test-site.yml new file mode 100644 index 0000000000..0bcb83d271 --- /dev/null +++ b/.github/workflows/test-site.yml @@ -0,0 +1,33 @@ +name: Test Site +on: + pull_request: + +permissions: + contents: read + +# Abort prior jobs in the same workflow / PR +concurrency: + group: site-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./site + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + + - name: npm ci + run: npm ci + + - name: run site build + run: npm run build + + - name: check links + run: npm run link-check diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 90429169f1..1f956b92a3 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -10,6 +10,10 @@ on: - "adr/**" - "docs/**" - "CODEOWNERS" + push: + # Running unit tests on main gives codecov a base to compare PRs against + branches: + - main permissions: contents: read @@ -31,8 +35,8 @@ jobs: - name: Run unit tests run: make test-unit - + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/site/hack/copy-examples.js b/site/hack/copy-examples.js index a410817149..a3cda64641 100644 --- a/site/hack/copy-examples.js +++ b/site/hack/copy-examples.js @@ -1,8 +1,10 @@ import { promises as fs } from "fs"; import path from "path"; import yaml from "yaml"; +import { fileURLToPath } from 'url'; -const __dirname = import.meta.dirname; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); const examplesDir = path.join(__dirname, "../../examples"); const dstDir = path.join(__dirname, "../src/content/docs/ref/Examples"); diff --git a/site/linkinator.config.json b/site/linkinator.config.json index dcf747e9a4..d9bfaf33b0 100644 --- a/site/linkinator.config.json +++ b/site/linkinator.config.json @@ -1,4 +1,4 @@ { - "skip": "^(https://.*github.com)", + "skip": "^(https://.*)", "verbosity": "error" } diff --git a/site/package-lock.json b/site/package-lock.json index 2fdfd8e985..9c0f032696 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -3166,11 +3166,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4575,9 +4576,10 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -5476,6 +5478,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -9930,6 +9933,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" },