Skip to content

Commit

Permalink
Merge pull request #46 from pozil/v5
Browse files Browse the repository at this point in the history
feat: release v5.0.0
  • Loading branch information
pozil authored Oct 20, 2024
2 parents 313c5cf + 29e86be commit cdb9fd6
Show file tree
Hide file tree
Showing 34 changed files with 7,062 additions and 1,374 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Unique name for this workflow
name: CI on PR

# Definition when the workflow should run
on:
workflow_dispatch:
pull_request:
types: [opened, edited, synchronize, reopened]

# Jobs to be executed
jobs:
format-lint-test:
runs-on: ubuntu-latest
env:
SALESFORCE_LOGIN_URL: ${{ secrets.SALESFORCE_LOGIN_URL }}
SALESFORCE_USERNAME: ${{ secrets.SALESFORCE_USERNAME }}
SALESFORCE_PASSWORD: ${{ secrets.SALESFORCE_PASSWORD }}
SALESFORCE_TOKEN: ${{ secrets.SALESFORCE_TOKEN }}
SALESFORCE_CLIENT_ID: ${{ secrets.SALESFORCE_CLIENT_ID }}
SALESFORCE_CLIENT_SECRET: ${{ secrets.SALESFORCE_CLIENT_SECRET }}
SALESFORCE_JWT_LOGIN_URL: ${{ secrets.SALESFORCE_JWT_LOGIN_URL }}
SALESFORCE_JWT_CLIENT_ID: ${{ secrets.SALESFORCE_JWT_CLIENT_ID }}
SALESFORCE_PRIVATE_KEY: ${{ secrets.SALESFORCE_PRIVATE_KEY }}

steps:
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v4
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: HUSKY=0 npm ci

# Format
- name: 'Format'
run: npm run format:verify

# Lint
- name: 'Lint'
run: npm run lint

# Configure test env
- name: 'Configure test environment'
run: |
touch .env
echo SALESFORCE_LOGIN_URL=$SALESFORCE_LOGIN_URL >> .env
echo SALESFORCE_USERNAME=$SALESFORCE_USERNAME >> .env
echo SALESFORCE_PASSWORD=$SALESFORCE_PASSWORD >> .env
echo SALESFORCE_TOKEN=$SALESFORCE_TOKEN >> .env
echo SALESFORCE_CLIENT_ID=$SALESFORCE_CLIENT_ID >> .env
echo SALESFORCE_CLIENT_SECRET=$SALESFORCE_CLIENT_SECRET >> .env
echo SALESFORCE_PRIVATE_KEY_PATH=server.key >> .env
echo SALESFORCE_JWT_LOGIN_URL=$SALESFORCE_JWT_LOGIN_URL >> .env
echo SALESFORCE_JWT_CLIENT_ID=$SALESFORCE_JWT_CLIENT_ID >> .env
echo "$SALESFORCE_PRIVATE_KEY" > server.key
# Integration tests
- name: 'Integration tests'
run: npm run test

# Housekeeping
- name: 'Delete test environment configuration'
if: always()
run: rm -f .env server.key
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Unique name for this workflow
name: CI

# Definition when the workflow should run
on:
workflow_dispatch:
push:
branches:
- main

# Jobs to be executed
jobs:
format-lint-test:
runs-on: ubuntu-latest
env:
SALESFORCE_LOGIN_URL: ${{ secrets.SALESFORCE_LOGIN_URL }}
SALESFORCE_USERNAME: ${{ secrets.SALESFORCE_USERNAME }}
SALESFORCE_PASSWORD: ${{ secrets.SALESFORCE_PASSWORD }}
SALESFORCE_TOKEN: ${{ secrets.SALESFORCE_TOKEN }}
SALESFORCE_CLIENT_ID: ${{ secrets.SALESFORCE_CLIENT_ID }}
SALESFORCE_CLIENT_SECRET: ${{ secrets.SALESFORCE_CLIENT_SECRET }}
SALESFORCE_JWT_LOGIN_URL: ${{ secrets.SALESFORCE_JWT_LOGIN_URL }}
SALESFORCE_JWT_CLIENT_ID: ${{ secrets.SALESFORCE_JWT_CLIENT_ID }}
SALESFORCE_PRIVATE_KEY: ${{ secrets.SALESFORCE_PRIVATE_KEY }}

steps:
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v4
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: HUSKY=0 npm ci

# Format
- name: 'Format'
run: npm run format:verify

# Lint
- name: 'Lint'
run: npm run lint

# Configure test env
- name: 'Configure test environment'
run: |
touch .env
echo SALESFORCE_LOGIN_URL=$SALESFORCE_LOGIN_URL >> .env
echo SALESFORCE_USERNAME=$SALESFORCE_USERNAME >> .env
echo SALESFORCE_PASSWORD=$SALESFORCE_PASSWORD >> .env
echo SALESFORCE_TOKEN=$SALESFORCE_TOKEN >> .env
echo SALESFORCE_CLIENT_ID=$SALESFORCE_CLIENT_ID >> .env
echo SALESFORCE_CLIENT_SECRET=$SALESFORCE_CLIENT_SECRET >> .env
echo SALESFORCE_PRIVATE_KEY_PATH=server.key >> .env
echo SALESFORCE_JWT_LOGIN_URL=$SALESFORCE_JWT_LOGIN_URL >> .env
echo SALESFORCE_JWT_CLIENT_ID=$SALESFORCE_JWT_CLIENT_ID >> .env
echo "$SALESFORCE_PRIVATE_KEY" > server.key
# Integration tests
- name: 'Integration tests'
run: npm run test

# Housekeeping
- name: 'Delete test environment configuration'
if: always()
run: rm -f .env server.key
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ node_modules
jsconfig.json
.vscode
.idea
package-lock.json

# MacOS system files
.DS_Store
Expand All @@ -25,4 +24,4 @@ ehthumbs.db
$RECYCLE.BIN/

# Sample code
sample.js
sample*
Loading

0 comments on commit cdb9fd6

Please sign in to comment.