Skip to content

feat: add diagnostic #1578

feat: add diagnostic

feat: add diagnostic #1578

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
- v1.x
pull_request:
types: [opened, synchronize]
branches:
- main
- v1.x
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.15.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out git repository
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install project dependencies
run: |
yarn install --frozen-lockfile
- name: Build all packages
run: |
yarn build
# https://github.com/amplitude/Amplitude-TypeScript/issues/281
- name: Check module dependencies
run: |
if grep -rnw 'packages/analytics-core/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-browser/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-marketing-analytics-browser/lib' -e '/// <reference types="node" />'; then
exit 1
elif grep -rnw 'packages/analytics-react-native/lib' -e '/// <reference types="node" />'; then
exit 1
fi
- name: Build docs
run: |
yarn docs:check
- name: Test all packages
run: |
yarn test
- name: Test all examples
run: |
yarn test:examples
- name: Lint all packages
run: |
yarn lint