Skip to content

Commit

Permalink
Merge branch 'next' into conditions-for-integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsoderberg committed Sep 11, 2023
2 parents 7c2a313 + 83b0579 commit ed118da
Show file tree
Hide file tree
Showing 106 changed files with 2,777 additions and 482 deletions.
7 changes: 5 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2",
"language": "en",
"words": [
"Springboot",
"tmproj",
"hgignore",
"bzrignore",
Expand Down Expand Up @@ -498,8 +499,10 @@
"reactjs",
"nextjs",
"vanillajs",
"quckstart",
"errmsg"
"errmsg",
"springboot",
"errmsg",
"shelljs"
],
"flagWords": [],
"patterns": [
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/checkout-submodules/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Checkout Submodules

description: Checkout private enterprise submodule

inputs:
enabled:
description: 'Run the action'
required: false
default: 'true'
submodule_token:
description: 'Submodule token to use for checkout'
required: true
submodule_branch:
description: 'Submodule branch to checkout to'
required: true

runs:
using: composite

steps:
- name: Checkout submodule
if: ${{ inputs.run == 'true' }}
uses: actions/checkout@v3
with:
token: ${{ inputs.submodule_token }}
repository: novuhq/packages-enterprise
path: enterprise/packages
ref: ${{ inputs.submodule_branch }}
7 changes: 5 additions & 2 deletions .github/workflows/dev-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

deploy_dev_api:
Expand All @@ -45,9 +46,11 @@ jobs:
name: ['novu/api-ee', 'novu/api']
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
enabled: ${{ contains (matrix.name,'ee') }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: "next"
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/docker/build-api
id: docker_build
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/dev-deploy-inbound-mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,35 @@ on:
- 'package.json'
- 'pnpm-lock.yaml'
- 'apps/inbound-mail/**'
- 'libs/dal/**'
- 'libs/shared/**'
- 'libs/testing/**'
env:
TF_WORKSPACE: novu-dev

jobs:
deploy_dev_inbound_mail:
if: "!contains(github.event.head_commit.message, 'ci skip')"
test_inbound_mail:
strategy:
matrix:
name: ['novu/inbound-mail-ee', 'novu/inbound-mail']
uses: ./.github/workflows/reusable-inbound-mail-e2e.yml
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

dev_deploy_inbound_mail:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: test_inbound_mail
timeout-minutes: 80
environment: Development
permissions:
contents: read
packages: write
deployments: write
id-token: write
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
# Only should be deploying inbound-mail-ee to dev
#name: ['novu/inbound-mail', 'novu/inbound-mail-ee']
name: ['novu/inbound-mail-ee']

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project

Expand All @@ -45,7 +49,6 @@ jobs:
with:
oidc: true


- name: Set Bull MQ Env variable for EE
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: ./.github/workflows/reusable-web-e2e.yml
with:
submodules: true
submodule_branch: 'next'
secrets: inherit

# This workflow contains a single job called "build"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev-deploy-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/reusable-widget-e2e.yml
with:
submodules: true
submodule_branch: "next"
secrets: inherit

# This workflow contains a single job called "build"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/dev-deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

deploy_dev_worker:
Expand All @@ -49,9 +50,11 @@ jobs:
name: ['novu/worker-ee', 'novu/worker']
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
enabled: ${{ contains (matrix.name,'ee') }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: "next"
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/docker/build-worker
id: docker_build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev-deploy-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: 'next'
secrets: inherit

# This workflow contains a single job called "build"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/prod-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "main"
secrets: inherit

build_prod_image:
Expand All @@ -36,9 +37,11 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
enabled: ${{ contains (matrix.name,'ee') }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: "main"
- uses: ./.github/actions/setup-project

- name: build api
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/prod-deploy-inbound-mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
workflow_dispatch:

jobs:
test_inbound_mail:
strategy:
matrix:
name: [ 'novu/inbound-mail-ee', 'novu/inbound-mail' ]
uses: ./.github/workflows/reusable-inbound-mail-e2e.yml
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "main"
secrets: inherit

build_prod_image:
runs-on: ubuntu-latest
timeout-minutes: 80
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
uses: ./.github/workflows/reusable-web-e2e.yml
with:
submodules: true
submodule_branch: 'main'
secrets: inherit

deploy_web_eu:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod-deploy-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/reusable-widget-e2e.yml
with:
submodules: true
submodule_branch: "main"
secrets: inherit

deploy_widget_eu:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/prod-deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "main"
secrets: inherit

build_prod_image:
Expand All @@ -37,9 +38,11 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
enabled: ${{ contains (matrix.name,'ee') }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: "main"
- uses: ./.github/actions/setup-project

- name: build worker
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/prod-deploy-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
workflow_dispatch:

jobs:
test_ws:
strategy:
matrix:
name: [ 'novu/ws-ee', 'novu/ws' ]
uses: ./.github/workflows/reusable-ws-e2e.yml
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: 'main'
secrets: inherit

# This workflow contains a single job called "build"
build_prod_image:
# The type of runner that the job will run on
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/reusable-api-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
required: false
default: false
type: boolean
submodule_branch:
description: 'Submodule branch to checkout to'
required: false
default: 'main'
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -39,15 +44,13 @@ jobs:
else
echo ::set-output has_token=false
fi
# checkout with submodules if token is provided
- uses: actions/checkout@v3
if: steps.setup.outputs.has_token == 'true'
# checkout with submodules if token is provided
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ inputs.submodules }}
token: ${{ secrets.SUBMODULES_TOKEN }}
# checkout without submodules
- uses: actions/checkout@v3
if: steps.setup.outputs.has_token != 'true'
enabled: ${{ steps.setup.outputs.has_token == 'true' }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: ${{ inputs.submodule_branch }}
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/setup-redis-cluster
- uses: mansagroup/nrwl-nx-action@v3
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/reusable-inbound-mail-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: E2E Inbound Mail Tests

# Controls when the action will run. Triggers the workflow on push or pull request
on:
workflow_call:
inputs:
ee:
description: 'use the ee version of worker'
required: false
default: false
type: boolean
submodules:
description: 'The flag controlling whether we want submodules to checkout'
required: false
default: false
type: boolean
submodule_branch:
description: 'Submodule branch to checkout to'
required: false
default: 'main'
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
e2e_inbound_mail:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 80

permissions:
contents: read
packages: write
deployments: write
id-token: write

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# checkout with submodules if token is provided
- uses: actions/checkout@v3
- uses: ./.github/actions/checkout-submodules
with:
enabled: ${{ steps.setup.outputs.has_token == 'true' }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: ${{ inputs.submodule_branch }}
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/setup-redis-cluster
- uses: mansagroup/nrwl-nx-action@v3
with:
targets: lint
projects: "@novu/inbound-mail"

# Runs a single command using the runners shell
- name: Build Inbound Mail
run: CI='' pnpm build:inbound-mail

- name: Run unit tests
run: |
cd apps/inbound-mail && pnpm test
17 changes: 10 additions & 7 deletions .github/workflows/reusable-web-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
default: false
type: boolean
submodule_branch:
description: 'Submodule branch to checkout to'
required: false
default: 'main'
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -45,15 +50,13 @@ jobs:
echo ::set-output has_token=false
fi
# checkout with submodules if token is provided
- uses: actions/checkout@v3
if: steps.setup.outputs.has_token == 'true'
# checkout with submodules if token is provided
- uses: ./.github/actions/checkout-submodules
with:
submodules: ${{ inputs.submodules }}
token: ${{ secrets.SUBMODULES_TOKEN }}
# checkout without submodules
- uses: actions/checkout@v3
if: steps.setup.outputs.has_token != 'true'
enabled: ${{ steps.setup.outputs.has_token == 'true' }}
submodule_token: ${{ secrets.SUBMODULES_TOKEN }}
submodule_branch: ${{ inputs.submodule_branch }}
- uses: ./.github/actions/setup-project
id: setup-project
with:
Expand Down
Loading

0 comments on commit ed118da

Please sign in to comment.