Skip to content

Fix deploy action #1795

Fix deploy action

Fix deploy action #1795

name: Functions | Emulated Unit Tests
on:
pull_request:
paths:
- packages/functions/**
- packages/database/**
jobs:
npm-install:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
id: cache
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm run build:functions
chunk_0:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/auth.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/auth/legacy.auth.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/address.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/auction/auction.bid.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/collection.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/member.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/nft.spec.ts
chunk_1:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/controls/nft/nft.bidding.extends.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/nft/nft.bidding.finalize.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/nft/nft.bidding.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/nft/nft.set.for.sale.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/order.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/project/project.create.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/project/project.deactivate.spec.ts
chunk_2:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/controls/proposal.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/space.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/stake.reward.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/stamp.control.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token-distribution-auto-trigger.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token-distribution.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token-trade.buy.spec.ts
chunk_3:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/controls/token-trade.sell.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token-trade.trigger.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token.expired.sale.cron.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token.order.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.airdrop.claim.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.airdrop.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.cancel.pub.sale.spec.ts
chunk_4:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.create.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.order.and.claim.air.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.rank.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.set.to.sale.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.update.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/token/token.vote.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/controls/workflow.spec.ts
chunk_5:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/cron/floor-price.cron.only.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/cron/nft-stake.cron.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/cron/proposal.cron.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/db.roll.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/func.name.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/naming.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/stake/delete.stake.reward.spec.ts
chunk_6:
needs: npm-install
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres
env:
POSTGRES_DB: buildcore
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 400
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
node_modules
packages/functions/node_modules
packages/interfaces/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}
- name: Init
run: npm run build:functions
- name: Test
working-directory: packages/functions
run: |
npm run start &
npm run notifier &
npm run test -- --findRelatedTests --forceExit ./test/stake/stake.reward.cron.spec.ts &&
npm run test -- --findRelatedTests --forceExit ./test/storage/resize.img.spec.ts