feat!: lit 3 update, migrate to vitest with browser mode #504
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 | |
on: | |
pull_request: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**/*.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
COVERAGE: false | |
IS_UBUNTU: false | |
NODE_VERSION: v0.0.0 | |
NPM_CACHE_DIR: ~/.npm | |
NPM_VERSION: 0.0.0 | |
jobs: | |
test: | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:') && !contains(github.event.head_commit.message, 'chore(release)')" | |
env: | |
IS_UBUNTU: ${{ contains(matrix.os, 'ubuntu') }} | |
name: ${{ matrix.os }} ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: latest | |
- name: Set node version to ${{ matrix.target }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.target }} | |
- name: List versions | |
run: | | |
echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV | |
echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV | |
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV | |
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV | |
echo "PNPM_VERSION=$(pnpm -v)" >> $GITHUB_ENV | |
echo "${{ github.workflow }}-${{ github.ref || github.run_id }}" | |
pwd | |
ls -la | |
which npm | |
# npm x -y -- envinfo@latest | |
- name: Cache dependencies | |
id: pnpm-cache | |
uses: actions/cache@v3 | |
with: | |
# See this glob workaround at https://github.com/actions/toolkit/issues/713. | |
path: | | |
${{ env.NPM_CACHE_DIR }}/* | |
!${{ env.NPM_CACHE_DIR }}/_npx | |
${{ env.PNPM_STORE_PATH }} | |
key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-pnpm-${{ env.PNPM_VERSION }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} | |
${{ matrix.os }}-node-${{ env.NODE_VERSION }}-pnpm-${{ env.PNPM_VERSION }} | |
- name: Install dependencies | |
run: | | |
npm pkg delete scripts.postinstall | |
pnpm install --frozen-lockfile | |
# sh $(npm root)/@reallyland/tools/list-npx-cache.sh | |
- name: Setup Playwright | |
run: | | |
# npx playwright install-deps | |
pnpm exec playwright install | |
- name: Lint | |
run: | | |
pnpm lint:build | |
- name: Test | |
if: env.IS_UBUNTU == 'false' | |
run: | | |
pnpm test:pw --no-coverage | |
- name: Test with coverage | |
if: env.IS_UBUNTU != 'false' | |
run: | | |
pnpm test:pw --color | |
- name: Upload coverage to codecov | |
if: env.IS_UBUNTU != 'false' && success() | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage/lcov.info | |
flags: unit_tests |