feat!: lit 3 update, migrate to vitest with browser mode #280
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-helpers | |
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 | |
TEST_HELPERS: true | |
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: [18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# - name: Setup node@${{ matrix.target }} | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: ${{ matrix.target }} | |
# - name: Install latest npm | |
# run: | | |
# npm i -g npm@latest | |
- 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 "${{ github.workflow }}-${{ github.ref || github.run_id }}" | |
pwd | |
ls -la | |
which npm | |
- name: Cache dependencies | |
id: npm-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 | |
key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Lint | |
run: | | |
npm run lint:build | |
- name: Test | |
if: env.IS_UBUNTU == 'false' | |
run: | | |
npm run wtr | |
- name: Test with coverage | |
if: env.IS_UBUNTU != 'false' | |
run: | | |
npm run wtr | |
env: | |
COVERAGE: true | |
- 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_helpers |