Skip to content

chore(npm): disable shameful hoisting #4405

chore(npm): disable shameful hoisting

chore(npm): disable shameful hoisting #4405

Workflow file for this run

---
name: CI
env:
CI: true
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest]
timeout-minutes: 10
name: Lint on Node.js ${{ matrix.node-version }}
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Linting
run: pnpm lint
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest]
timeout-minutes: 10
name: Build on Node.js ${{ matrix.node-version }}
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Building
run: pnpm build
- name: Cache dist
uses: actions/cache@v3
with:
path: dist
key: ${{ matrix.os }}-node-v${{ matrix.node-version }}-${{ github.sha }}
test:
needs:
- build
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest]
timeout-minutes: 25
name: Test on Node.js ${{ matrix.node-version }}
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L91
# Install playwright's binary under custom directory to cache
- name: (non-windows) Set Playwright path and Get playwright version
if: runner.os != 'Windows'
run: |
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright | jq --raw-output '.[0].devDependencies["playwright"].version')"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: (windows) Set Playwright path and Get playwright version
if: runner.os == 'Windows'
run: |
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright | jq --raw-output '.[0].devDependencies[\"playwright\"].version')"
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
- name: Cache Playwright's binary
uses: actions/cache@v3
with:
key: ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }}
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
restore-keys: |
${{ runner.os }}-playwright-bin-v1-
- name: Install Playwright
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium
- name: Restore dist cache
uses: actions/cache@v3
with:
path: dist
key: ${{ matrix.os }}-node-v${{ matrix.node-version }}-${{ github.sha }}
- name: Testing
run: pnpm test
edge-release:
needs:
- lint
- build
- test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest]
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Restore dist cache
uses: actions/cache@v3
with:
path: dist
key: ${{ matrix.os }}-node-v${{ matrix.node-version }}-${{ github.sha }}
- name: Release Edge
if: |
github.event_name == 'push' &&
!startsWith(github.event.head_commit.message, '[skip-release]') &&
!startsWith(github.event.head_commit.message, 'chore') &&
!startsWith(github.event.head_commit.message, 'docs')
run: ./scripts/release-edge.sh
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}