Skip to content

Commit

Permalink
Merge pull request #4121 from novuhq/test-ref-submodule-branch
Browse files Browse the repository at this point in the history
Build submodule package by branch
  • Loading branch information
djabarovgeorge authored Sep 10, 2023
2 parents e741310 + f6ac300 commit 41622c6
Show file tree
Hide file tree
Showing 20 changed files with 147 additions and 48 deletions.
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
1 change: 1 addition & 0 deletions .github/workflows/dev-deploy-inbound-mail.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

dev_deploy_inbound_mail:
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
16 changes: 9 additions & 7 deletions .github/workflows/reusable-inbound-mail-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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 @@ -33,14 +38,11 @@ jobs:
steps:
# checkout with submodules if token is provided
- uses: actions/checkout@v3
if: steps.setup.outputs.has_token == 'true'
- 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
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
17 changes: 10 additions & 7 deletions .github/workflows/reusable-widget-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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 @@ -44,15 +49,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
id: setup-project
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/reusable-worker-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,16 +44,15 @@ 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
with:
Expand Down
Loading

0 comments on commit 41622c6

Please sign in to comment.