Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the cypress workflow to support overriding the dependency versions. #629

Merged
23 changes: 20 additions & 3 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_VERSION: '3.0.0-SNAPSHOT'
SECURITY_ANALYTICS_BRANCH: 'main'
OPENSEARCH_DASHBOARDS_VERSION: '2.8.0'
OPENSEARCH_VERSION: '2.8.0-SNAPSHOT'
SECURITY_ANALYTICS_BRANCH: '2.x'
GRADLE_VERSION: '7.6.1'

# If this variable is not empty, the package.json, opensearch_dashboards.json, and yarn.lock files will be replaced
# with those files from the 'opensearch-project/security-analytics-dashboards-plugin' branch or commit specified.
OVERRIDE_REFERENCE: '2.8'
jobs:
tests:
name: Run Cypress E2E tests
Expand Down Expand Up @@ -70,6 +74,19 @@ jobs:
with:
path: OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin

# This job replaces the package.json, opensearch_dashboards.json, and yarn.lock files from the
# 'opensearch-project/security-analytics-dashboards-plugin' branch or commit specified in env variable.
# This is most useful on the 'main' branch as it will enable us to specify which version to use for the build when
# one of this package's dependencies is not building reliably without having to adjust the actual version of this package.
- name: Override Package Version
if: ${{ env.OVERRIDE_REFERENCE != '' }}
run: |
cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin
git fetch --all
git checkout origin/${{ env.OVERRIDE_REFERENCE }} opensearch_dashboards.json
git checkout origin/${{ env.OVERRIDE_REFERENCE }} package.json
git checkout origin/${{ env.OVERRIDE_REFERENCE }} yarn.lock

- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down