Skip to content

Commit

Permalink
Merge pull request #45 from Relewise/feat/new-pipelines
Browse files Browse the repository at this point in the history
feat: update pipelines to support both packages
  • Loading branch information
mzanoni authored Nov 10, 2023
2 parents b341a54 + a7c808b commit 425ed30
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 8 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,36 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/client
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.com/
scope: '@relewise'
- name: Update version
uses: brettdorrans/write-version-to-file@master

- name: Calculate environment variables
run: |
echo "TAG_NAME=$(github.event.tag_name)"
echo "PACKAGE_PATH=$(github.event.tag_name.split('@')[0])" >> $GITHUB_ENV
echo "VERSION=$(github.event.tag_name.split('@')[1])" >> $GITHUB_ENV
- uses: brettdorrans/write-version-to-file@master
if: ${{ PACKAGE_PATH == 'client' }}
name: Update version
working-directory: ./packages/${ PACKAGE_PATH }
with:
filename: './packages/client/src/version.ts'
filename: './src/version.ts'
placeholder: '${VERSION}'

- run: npm ci
working-directory: ./packages/${ PACKAGE_PATH }

- run: npm run publish
working-directory: ./packages/${ PACKAGE_PATH }

- run: npm publish --access public
working-directory: ./packages/${ PACKAGE_PATH }
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
27 changes: 26 additions & 1 deletion .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
node-version: '18'

jobs:
test:
test-sdk:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -33,6 +33,31 @@ jobs:
name: Build Types
- run: npm test
name: Unit tests
- run: npm run integration-test
env:
npm_config_DATASET_ID: ${{secrets.INTEGRATIONTESTS_DATASET_ID}}
npm_config_API_KEY: ${{secrets.INTEGRATIONTESTS_API_KEY}}
name: Integration tests

test-integrations:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/integrations
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- run: npm ci
name: Install dependencies
- run: npm run build
name: Build
- run: npm test
name: Unit tests
- run: npm run integration-test
env:
npm_config_DATASET_ID: ${{secrets.INTEGRATIONTESTS_DATASET_ID}}
Expand Down
14 changes: 14 additions & 0 deletions packages/integrations/tests/unit-tests/integrator.unit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import { expect, test } from '@jest/globals';
import { Integrator } from '../../src';

const integrator = new Integrator('dummy value', 'dummy value');

test('Batch size', async() => {
expect(integrator.batchSize).toBe(1_000);
});

test('Batch size', async() => {
integrator.batchSize = 2;
expect(integrator.batchSize).toBe(2);
});

0 comments on commit 425ed30

Please sign in to comment.