Skip to content

Update README for cdp-analytics-browser. (#55) #65

Update README for cdp-analytics-browser. (#55)

Update README for cdp-analytics-browser. (#55) #65

name: Verify Browser Package Build & Install
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Cache node modules
id: cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn install
- name: Build the package
run: |
export NODE_OPTIONS=--openssl-legacy-provider
yarn build
- name: Pack `packages/browser`
run: |
cd packages/browser
npm pack
echo "PACKAGE_NAME=$(ls *.tgz)" >> $GITHUB_ENV
- name: Test installing the package in a fresh environment
run: |
rm -rf node_modules
cd .github/test-app
echo $PACKAGE_NAME
npm install ../../packages/browser/$PACKAGE_NAME --loglevel=verbose
npm run build