Skip to content

Refactor projectIdSingleton -> hostUrlSingleton #351

Refactor projectIdSingleton -> hostUrlSingleton

Refactor projectIdSingleton -> hostUrlSingleton #351

Workflow file for this run

name: Pull Request
on:
pull_request: {}
push:
branches:
- main
workflow_dispatch: {}
workflow_call:
secrets:
PINECONE_API_KEY:
required: true
jobs:
basic-hygiene:
name: Linting, formatting, documentation, etc
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Prettier
run: npm run format
- name: Check for prettier changes
run: |
git diff --exit-code >/dev/null 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Prettier changes detected. Please run 'npm run format' and commit the changes."
exit 1
fi
- name: ESLint
run: npm run lint
- name: TypeDoc
uses: ./.github/actions/build-docs
run-integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jest_env: ['node', 'edge']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Run tests
env:
CI: true
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
run: npm run test:integration:${{ matrix.jest_env }}
example-app-semantic-search:
name: 'Example app: semantic search'
runs-on: ubuntu-latest
steps:
- name: Checkout pinecone-ts-client
uses: actions/checkout@v4
with:
path: pinecone-ts-client
- name: Checkout semantic-search-example
uses: actions/checkout@v4
with:
repository: pinecone-io/semantic-search-example
path: semantic-search-example
- name: Install and build client
shell: bash
run: |
cd pinecone-ts-client
npm install --ignore-scripts
npm run build
- name: Install and build sample app
shell: bash
run: |
cd semantic-search-example
npm install --no-cache
npm install '../pinecone-ts-client'
cat package.json
- name: Run example tests with dev version of client
env:
CI: true
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_INDEX: 'semantic-search'
shell: bash
run: |
cd semantic-search-example
npm run test
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Run tests
env:
CI: true
run: npm run test:unit -- --coverage
typescript-compilation-tests:
name: TS compile
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tsVersion:
[
'~4.1.0',
'~4.2.0',
'~4.3.0',
'~4.4.0',
'~4.5.0',
'~4.6.0',
'~4.7.0',
'~4.8.0',
'~4.9.0',
'~5.0.0',
'~5.1.0',
'~5.2.0',
'latest',
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- name: Install npm packages
run: |
npm install --ignore-scripts
shell: bash
- name: Build typescript for pinecone
run: npm run build
shell: bash
- name: install, compile, and run sample app
shell: bash
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
run: |
set -x
cd ..
cp -r pinecone-ts-client/ts-compilation-test ts-compilation-test
cd ts-compilation-test
npm install typescript@${{matrix.tsVersion}} --no-cache
npm install '../pinecone-ts-client' --no-cache
cat package.json
cat package-lock.json
npm run tsc-version
npm run build
npm run start