Skip to content

Commit cdb9fd6

Browse files
authored
Merge pull request #46 from pozil/v5
feat: release v5.0.0
2 parents 313c5cf + 29e86be commit cdb9fd6

34 files changed

+7062
-1374
lines changed

.github/workflows/ci-pr.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Unique name for this workflow
2+
name: CI on PR
3+
4+
# Definition when the workflow should run
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, edited, synchronize, reopened]
9+
10+
# Jobs to be executed
11+
jobs:
12+
format-lint-test:
13+
runs-on: ubuntu-latest
14+
env:
15+
SALESFORCE_LOGIN_URL: ${{ secrets.SALESFORCE_LOGIN_URL }}
16+
SALESFORCE_USERNAME: ${{ secrets.SALESFORCE_USERNAME }}
17+
SALESFORCE_PASSWORD: ${{ secrets.SALESFORCE_PASSWORD }}
18+
SALESFORCE_TOKEN: ${{ secrets.SALESFORCE_TOKEN }}
19+
SALESFORCE_CLIENT_ID: ${{ secrets.SALESFORCE_CLIENT_ID }}
20+
SALESFORCE_CLIENT_SECRET: ${{ secrets.SALESFORCE_CLIENT_SECRET }}
21+
SALESFORCE_JWT_LOGIN_URL: ${{ secrets.SALESFORCE_JWT_LOGIN_URL }}
22+
SALESFORCE_JWT_CLIENT_ID: ${{ secrets.SALESFORCE_JWT_CLIENT_ID }}
23+
SALESFORCE_PRIVATE_KEY: ${{ secrets.SALESFORCE_PRIVATE_KEY }}
24+
25+
steps:
26+
# Checkout the source code
27+
- name: 'Checkout source code'
28+
uses: actions/checkout@v4
29+
30+
# Install Volta to enforce proper node and package manager versions
31+
- name: 'Install Volta'
32+
uses: volta-cli/action@v4
33+
34+
# Cache node_modules to speed up the process
35+
- name: 'Restore node_modules cache'
36+
id: cache-npm
37+
uses: actions/cache@v4
38+
with:
39+
path: node_modules
40+
key: npm-${{ hashFiles('**/package-lock.json') }}
41+
restore-keys: |
42+
npm-${{ env.cache-name }}-
43+
npm-
44+
45+
# Install npm dependencies
46+
- name: 'Install npm dependencies'
47+
if: steps.cache-npm.outputs.cache-hit != 'true'
48+
run: HUSKY=0 npm ci
49+
50+
# Format
51+
- name: 'Format'
52+
run: npm run format:verify
53+
54+
# Lint
55+
- name: 'Lint'
56+
run: npm run lint
57+
58+
# Configure test env
59+
- name: 'Configure test environment'
60+
run: |
61+
touch .env
62+
echo SALESFORCE_LOGIN_URL=$SALESFORCE_LOGIN_URL >> .env
63+
echo SALESFORCE_USERNAME=$SALESFORCE_USERNAME >> .env
64+
echo SALESFORCE_PASSWORD=$SALESFORCE_PASSWORD >> .env
65+
echo SALESFORCE_TOKEN=$SALESFORCE_TOKEN >> .env
66+
echo SALESFORCE_CLIENT_ID=$SALESFORCE_CLIENT_ID >> .env
67+
echo SALESFORCE_CLIENT_SECRET=$SALESFORCE_CLIENT_SECRET >> .env
68+
echo SALESFORCE_PRIVATE_KEY_PATH=server.key >> .env
69+
echo SALESFORCE_JWT_LOGIN_URL=$SALESFORCE_JWT_LOGIN_URL >> .env
70+
echo SALESFORCE_JWT_CLIENT_ID=$SALESFORCE_JWT_CLIENT_ID >> .env
71+
echo "$SALESFORCE_PRIVATE_KEY" > server.key
72+
73+
# Integration tests
74+
- name: 'Integration tests'
75+
run: npm run test
76+
77+
# Housekeeping
78+
- name: 'Delete test environment configuration'
79+
if: always()
80+
run: rm -f .env server.key

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Unique name for this workflow
2+
name: CI
3+
4+
# Definition when the workflow should run
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
11+
# Jobs to be executed
12+
jobs:
13+
format-lint-test:
14+
runs-on: ubuntu-latest
15+
env:
16+
SALESFORCE_LOGIN_URL: ${{ secrets.SALESFORCE_LOGIN_URL }}
17+
SALESFORCE_USERNAME: ${{ secrets.SALESFORCE_USERNAME }}
18+
SALESFORCE_PASSWORD: ${{ secrets.SALESFORCE_PASSWORD }}
19+
SALESFORCE_TOKEN: ${{ secrets.SALESFORCE_TOKEN }}
20+
SALESFORCE_CLIENT_ID: ${{ secrets.SALESFORCE_CLIENT_ID }}
21+
SALESFORCE_CLIENT_SECRET: ${{ secrets.SALESFORCE_CLIENT_SECRET }}
22+
SALESFORCE_JWT_LOGIN_URL: ${{ secrets.SALESFORCE_JWT_LOGIN_URL }}
23+
SALESFORCE_JWT_CLIENT_ID: ${{ secrets.SALESFORCE_JWT_CLIENT_ID }}
24+
SALESFORCE_PRIVATE_KEY: ${{ secrets.SALESFORCE_PRIVATE_KEY }}
25+
26+
steps:
27+
# Checkout the source code
28+
- name: 'Checkout source code'
29+
uses: actions/checkout@v4
30+
31+
# Install Volta to enforce proper node and package manager versions
32+
- name: 'Install Volta'
33+
uses: volta-cli/action@v4
34+
35+
# Cache node_modules to speed up the process
36+
- name: 'Restore node_modules cache'
37+
id: cache-npm
38+
uses: actions/cache@v4
39+
with:
40+
path: node_modules
41+
key: npm-${{ hashFiles('**/package-lock.json') }}
42+
restore-keys: |
43+
npm-${{ env.cache-name }}-
44+
npm-
45+
46+
# Install npm dependencies
47+
- name: 'Install npm dependencies'
48+
if: steps.cache-npm.outputs.cache-hit != 'true'
49+
run: HUSKY=0 npm ci
50+
51+
# Format
52+
- name: 'Format'
53+
run: npm run format:verify
54+
55+
# Lint
56+
- name: 'Lint'
57+
run: npm run lint
58+
59+
# Configure test env
60+
- name: 'Configure test environment'
61+
run: |
62+
touch .env
63+
echo SALESFORCE_LOGIN_URL=$SALESFORCE_LOGIN_URL >> .env
64+
echo SALESFORCE_USERNAME=$SALESFORCE_USERNAME >> .env
65+
echo SALESFORCE_PASSWORD=$SALESFORCE_PASSWORD >> .env
66+
echo SALESFORCE_TOKEN=$SALESFORCE_TOKEN >> .env
67+
echo SALESFORCE_CLIENT_ID=$SALESFORCE_CLIENT_ID >> .env
68+
echo SALESFORCE_CLIENT_SECRET=$SALESFORCE_CLIENT_SECRET >> .env
69+
echo SALESFORCE_PRIVATE_KEY_PATH=server.key >> .env
70+
echo SALESFORCE_JWT_LOGIN_URL=$SALESFORCE_JWT_LOGIN_URL >> .env
71+
echo SALESFORCE_JWT_CLIENT_ID=$SALESFORCE_JWT_CLIENT_ID >> .env
72+
echo "$SALESFORCE_PRIVATE_KEY" > server.key
73+
74+
# Integration tests
75+
- name: 'Integration tests'
76+
run: npm run test
77+
78+
# Housekeeping
79+
- name: 'Delete test environment configuration'
80+
if: always()
81+
run: rm -f .env server.key

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ node_modules
1313
jsconfig.json
1414
.vscode
1515
.idea
16-
package-lock.json
1716

1817
# MacOS system files
1918
.DS_Store
@@ -25,4 +24,4 @@ ehthumbs.db
2524
$RECYCLE.BIN/
2625

2726
# Sample code
28-
sample.js
27+
sample*

0 commit comments

Comments
 (0)