Skip to content

Import Emitter type into cwa #1359

Import Emitter type into cwa

Import Emitter type into cwa #1359

Workflow file for this run

name: ci
on:
push:
branches:
- '*'
- '!main'
pull_request:
branches-ignore:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [lts/*,latest]
include:
- node: latest
coverage: true
lint: true
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Enable corepack and PNPM
run: |
corepack enable
corepack prepare pnpm@latest --activate
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Prepare
run: pnpm run dev:prepare
- name: Lint
if: matrix.lint
run: pnpm run lint
- name: Build module
run: pnpm run dev:build
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Unit tests
run: |
mkdir -p coverage
if [ "$COVERAGE" = '1' ]; then
pnpm run test:coverage
else
pnpm run test
fi
env:
CI: true
- name: Upload test artifacts
if: matrix.coverage
uses: actions/upload-artifact@v3
with:
name: vitest-logs-unit${{ matrix.node }}
path: ./coverage
if-no-files-found: error
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
name: vitest-node-${{ matrix.node }}
flags: vitest
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
- name: Audit
run: pnpm audit
deploy-next:
if: github.ref == 'refs/heads/nuxt3'
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Enable corepack and PNPM
run: |
corepack enable
corepack prepare pnpm@latest --activate
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Update package name and version number
run: node ./scripts/bump-next.cjs
- name: Publish Next
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc
pnpm dev:prepare
npm publish
env:
GIT_REF: ${{ github.ref }}
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
# e2e:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node: [16]
# fail-fast: true
# container: cypress/included:10.11.0
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Install SASS dependencies
# run: |
# apt-get update
# apt-get install -y g++ build-essential
# - name: Use Node.js ${{ matrix.node }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# - name: Cache Node.js modules
# uses: actions/cache@v3
# with:
# path: ~/.yarn
# key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.OS }}-node-
# ${{ runner.OS }}-
# - name: Install dependencies
# run: yarn --frozen-lockfile
# - name: Start API, Build and Start Demo Application
# env:
# API_PORT: 3100
# API_URL: http://localhost:3100
# NODE_TLS_REJECT_UNAUTHORIZED: 0
# DISABLE_HTTPS: true
# TESTING: true
# run: |
# yarn api &
# yarn run demo:build
# yarn run demo:start &
# npx wait-on 'http://localhost:3000'
# curl -XGET localhost:3000
# - name: Run E2E
# env:
# CYPRESS_BASE_URL: http://localhost:3000
# run: yarn e2e --record --key=${{secrets.CYPRESS_RECORD_KEY}}