Skip to content

Commit

Permalink
ci: trigger sanity suite on pre post release (#1843)
Browse files Browse the repository at this point in the history
* ci: trigger sanity suite on pre post release

* chore: updated github actions

* chore: updated github actions

* chore: updated github actions
  • Loading branch information
MoumitaM authored Sep 4, 2024
1 parent d70d218 commit 74652d7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 35 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/browserstack-sanity.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ jobs:
RS_PROD_BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID_NON_PROD }}

trigger-sanity-suite:
uses: ./.github/workflows/trigger-sanity-suite.yml
name: Trigger Sanity Suite
with:
environment: production
6 changes: 6 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ jobs:
RS_STAGING_BUGSNAG_API_KEY: ${{ secrets.RS_STAGING_BUGSNAG_API_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID_NON_PROD }}

trigger-sanity-suite:
uses: ./.github/workflows/trigger-sanity-suite.yml
name: Trigger Sanity Suite
with:
environment: staging
67 changes: 67 additions & 0 deletions .github/workflows/trigger-sanity-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Run sanity suite on BrowserStack

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select specific environment to run the tests
options:
- staging
- production
monorepoVersion:
description: Version of the Monorepo
required: true
workflow_call:
inputs:
environment:
type: string
default: production

jobs:
extract-monorepo-version:
name: Extract Monorepo Version
runs-on: ubuntu-latest

outputs:
version: ${{ steps.determine_version.outputs.current_version }}

steps:
- name: Determine checkout SHA
id: getSHA
run: |
if [ "${{ inputs.environment }}" = 'staging' ]; then
sha=${{ github.event.pull_request.head.sha }}
else
sha=${{ github.sha }}
fi
echo "Checkout SHA: $sha"
echo "SHA=$sha" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.getSHA.outputs.SHA }}

- name: Determine the Monorepo version
id: determine_version
run: |
if [ -n "${{ inputs.monorepoVersion }}" ]; then
current_version="${{ inputs.monorepoVersion }}"
else
current_version=$(jq -r .version package.json)
fi
echo "current_version=$current_version" >> $GITHUB_OUTPUT
trigger:
runs-on: [self-hosted, Linux, X64]
needs: extract-monorepo-version

steps:
- name: Trigger sanity suite test workflow on rudder-client-side-test
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/rudderlabs/rudder-client-side-test/dispatches \
-d '{"event_type":"triggered_by_source_repo", "client_payload": {"environment": "${{ github.event.inputs.environment }}", "monorepoVersion": "${{ needs.extract-monorepo-version.outputs.version }}"}}'

0 comments on commit 74652d7

Please sign in to comment.