Skip to content

Commit

Permalink
run tests on PR and pushes to main, add github publish (#25)
Browse files Browse the repository at this point in the history
* run tests on PR and pushes to main

* update version

* add github publish

* fix action
  • Loading branch information
vvillait88 authored May 18, 2022
1 parent 8edf56f commit fe606b2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 17 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Package to Github

on:
release:
types: [published]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: yarn run test
env:
PDL_API_KEY: ${{secrets.PDL_API_KEY}}

publish-gpr:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: yarn
- run: yarn run pub
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 3 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
publish-npm:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Test Package

on: [pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
Expand Down
27 changes: 12 additions & 15 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ PDLJSClient.person.identify({ phone: '4155688415' }).then((data) => {

const records = {
requests: [
{
params: {
profile: ['linkedin.com/in/seanthorne'],
},
},
{
params: {
profile: ['linkedin.com/in/randrewn'],
},
},
{ params: { profile: ['linkedin.com/in/seanthorne'] } },
{ params: { profile: ['linkedin.com/in/randrewn'] } },
],
};

Expand All @@ -43,7 +35,10 @@ PDLJSClient.person.bulk(records).then((data) => {
console.log(error);
});

PDLJSClient.person.search.sql({ searchQuery: "SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health'AND phone_numbers IS NOT NULL;", size: 10 }).then((data) => {
PDLJSClient.person.search.sql({
searchQuery: "SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health'AND phone_numbers IS NOT NULL;",
size: 10,
}).then((data) => {
console.log(data);
}).catch((error) => {
console.log(error);
Expand All @@ -67,9 +62,7 @@ PDLJSClient.company.search.elastic({
searchQuery: {
query: {
bool: {
must: [
{ term: { website: 'peopledatalabs.com' } },
],
must: [{ term: { website: 'peopledatalabs.com' } }],
},
},
},
Expand All @@ -82,7 +75,11 @@ PDLJSClient.company.search.elastic({

// Supporting APIs

PDLJSClient.autocomplete({ field: 'skill', text: 'c++', size: 10 }).then((data) => {
PDLJSClient.autocomplete({
field: 'skill',
text: 'c++',
size: 10,
}).then((data) => {
console.log(data);
}).catch((error) => {
console.log(error);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peopledatalabs",
"version": "3.1.0",
"version": "3.1.1",
"description": "JavaScript client with TypeScript support for the People Data Labs API",
"type": "module",
"main": "dist/index.cjs",
Expand Down

0 comments on commit fe606b2

Please sign in to comment.