Skip to content

chore(deps): migrate from insane to isomorphic-dompurify #1236

chore(deps): migrate from insane to isomorphic-dompurify

chore(deps): migrate from insane to isomorphic-dompurify #1236

name: NPM Publish simulation
on:
pull_request:
# No GITHUB_TOKEN permissions, as we only use it to increase API limit.
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: (mdn/fred) Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
path: mdn/fred
persist-credentials: false
- name: (mdn/fred) Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: mdn/fred/.nvmrc
cache: npm
cache-dependency-path: mdn/fred/package-lock.json
# Ensure npm 11.5.1 or later for trusted publishing
- name: Install latest npm
run: npm install -g npm@latest
- name: (mdn/fred) Install all npm packages
working-directory: mdn/fred
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: (mdn/fred) Build tarball
id: build
working-directory: mdn/fred
run: |
npm pack
TARBALL=`ls mdn-fred-*.tgz`
echo $TARBALL
ls -lh $TARBALL
echo "tarball=$TARBALL" >> "$GITHUB_OUTPUT"
- name: (mdn/fred) archive tarball
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tarball
path: mdn/fred/${{ steps.build.outputs.tarball }}
compression-level: 0 # file already compressed
test:
needs: build
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: (mdn/content) Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: mdn/content
path: mdn/content
persist-credentials: false
- name: (mdn/content) Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: mdn/content/.nvmrc
cache: npm
cache-dependency-path: mdn/content/package-lock.json
- name: (mdn/content) Download tarball
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: tarball
- name: (mdn/content) Install tarball
working-directory: mdn/content
shell: bash
run: |
npm cache clean --force
TARBALL=$(ls ../../mdn-fred-*.tgz)
npm install file:$TARBALL
npm install
env:
# Increase GitHub API limit.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: (mdn/content) Render (Linux)
if: runner.os == 'Linux'
working-directory: mdn/content
run: npx fred-ssr
- name: (mdn/fred) Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
path: mdn/fred
persist-credentials: false
- name: (mdn/fred) Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: mdn/fred/.nvmrc
cache: npm
cache-dependency-path: mdn/fred/package-lock.json
- name: (mdn/fred) Install all npm packages
working-directory: mdn/fred
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: (mdn/fred) Run tests
id: build
working-directory: mdn/fred
env:
FRED_PORT: 5042
CONTENT_REPO_ROOT: ../content
# Increase GitHub API limit.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node scripts/npm-test.js