test: assert lazy load fetched locales #4007
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
env: | |
CI: true | |
on: | |
push: | |
branches: | |
- next | |
pull_request: | |
branches: | |
- next | |
jobs: | |
lint: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [16] | |
os: [ubuntu-latest] | |
timeout-minutes: 10 | |
name: Lint on Node.js ${{ matrix.node-version }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v3 | |
- 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: [16] | |
os: [ubuntu-latest] | |
timeout-minutes: 10 | |
name: Build on Node.js ${{ matrix.node-version }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v3 | |
- 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: [16] | |
os: [ubuntu-latest] | |
timeout-minutes: 15 | |
name: Test on Node.js ${{ matrix.node-version }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v3 | |
- 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#L62 | |
# Install playwright's binary under custom directory to cache | |
- name: Set Playwright path (non-windows) | |
if: runner.os != 'Windows' | |
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV | |
- name: Set Playwright path (windows) | |
if: runner.os == 'Windows' | |
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV | |
- name: Cache Playwright's binary | |
uses: actions/cache@v3 | |
with: | |
# Playwright removes unused browsers automatically | |
# So does not need to add playwright version to key | |
key: ${{ runner.os }}-playwright-bin-v1 | |
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | |
- 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: [16] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v3 | |
- 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' && | |
!contains(github.event.head_commit.message, '[skip-release]') && | |
!contains(github.event.head_commit.message, 'chore') && | |
!contains(github.event.head_commit.message, 'docs') | |
run: ./scripts/release-edge.sh | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |