Skip to content

Commit

Permalink
ci: seperate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
cshezi committed Jan 11, 2024
1 parent 2c515cd commit e7b88f4
Showing 1 changed file with 77 additions and 36 deletions.
113 changes: 77 additions & 36 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
env:
NODE_ENV: 'dev'
STARTUP_TYPE: 'nats'
SERVER_URL: 'nats://localhost:4222'
PRODUCER_STREAM: CRSP
CONSUMER_STREAM: TMS
ACK_POLICY: 'None'
STREAM_SUBJECT:
APM_ACTIVE: false
APM_LOGGING: false
FUNCTION_NAME: 'transaction-monitoring-service'
REDIS_DB: 0
REDIS_AUTH:
REDIS_SERVERS: '[{"host":"127.0.0.1", "port":6379}]'
REDIS_IS_CLUSTER: false
DATABASE_NAME: Configuration
DATABASE_URL: 'http://localhost:8529/'
DATABASE_USER: root
DATABASE_PASSWORD:
PSEUDONYMS_DATABASE: pseudonyms
TRANSACTIONHISTORY_DATABASE: transactionHistory
DATABASE_CERT_PATH: ''
NODE_TLS_REJECT_UNAUTHORIZED: '0'
TRANSACTIONHISTORY_PAIN001_COLLECTION: transactionHistoryPain001
TRANSACTIONHISTORY_PAIN013_COLLECTION: transactionHistoryPain013
TRANSACTIONHISTORY_PACS008_COLLECTION: transactionHistoryPacs008
TRANSACTIONHISTORY_PACS002_COLLECTION: transactionHistoryPacs002
QUOTING: true
PORT: 3000
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
NPM_SCOPE: "@frmscoe"
NPM_REGISTRY: "https://npm.pkg.github.com/"
on:
push:
branches: [ "main" ]
Expand Down Expand Up @@ -61,47 +93,11 @@ jobs:
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Run unit tests
run: npm run test
env:
NODE_ENV: 'test'
STARTUP_TYPE: 'nats'

- name: Processor Build
run: npm run build

- name: Processor Start
run: npm run start &
env:
NODE_ENV: 'dev'
STARTUP_TYPE: 'nats'
SERVER_URL: 'nats://localhost:4222'
PRODUCER_STREAM: CRSP
CONSUMER_STREAM: TMS
ACK_POLICY: 'None'
STREAM_SUBJECT:
APM_ACTIVE: false
APM_LOGGING: false
FUNCTION_NAME: 'transaction-monitoring-service'
REDIS_DB: 0
REDIS_AUTH:
REDIS_SERVERS: '[{"host":"127.0.0.1", "port":6379}]'
REDIS_IS_CLUSTER: false
DATABASE_NAME: Configuration
DATABASE_URL: 'http://localhost:8529/'
DATABASE_USER: root
DATABASE_PASSWORD:
PSEUDONYMS_DATABASE: pseudonyms
TRANSACTIONHISTORY_DATABASE: transactionHistory
DATABASE_CERT_PATH: ''
NODE_TLS_REJECT_UNAUTHORIZED: '0'
TRANSACTIONHISTORY_PAIN001_COLLECTION: transactionHistoryPain001
TRANSACTIONHISTORY_PAIN013_COLLECTION: transactionHistoryPain013
TRANSACTIONHISTORY_PACS008_COLLECTION: transactionHistoryPacs008
TRANSACTIONHISTORY_PACS002_COLLECTION: transactionHistoryPacs002
QUOTING: true
PORT: 3000


- name: Test Processor
run: newman run https://raw.githubusercontent.com/frmscoe/postman/main/micro_processors/TransactionMessageSubmitterProcessor_Proxt_Test.postman_collection.json -e https://raw.githubusercontent.com/frmscoe/postman/main/environments/Ekuta-LOCAL.postman_environment.json --timeout-request 10200 -r json --reporter-json-export fullReport.json
Expand Down Expand Up @@ -150,3 +146,48 @@ jobs:
-H "Content-Type: application/json" \
--data-raw "{\"body\":\"$COMMENT_BODY\"}" \
$API_URL
test:
runs-on: ubuntu-latest
name: unit tests
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: ${{ env.NPM_REGISTRY }}
scope: ${{ env.NPM_SCOPE }}
- name: Install dependencies
run: npm ci
env:
NODE_ENV: 'test'

lint:
runs-on: ubuntu-latest
name: check style
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: ${{ env.NPM_REGISTRY }}
scope: ${{ env.NPM_SCOPE }}
- name: Install dependencies
run: npm ci
- name: Check linting
run: npm run lint



0 comments on commit e7b88f4

Please sign in to comment.