Skip to content

Commit

Permalink
Updated the cypress workflow to support overriding the dependency ver…
Browse files Browse the repository at this point in the history
…sions. (#629)

* Updated the cypress workflow to support overriding the dependency versions.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Overrode test workflow dependency versions to v2.8.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Fixed override workflow.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Adjusted workflow job order.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Made gradle setup conditional.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Made gradle setup unconditional again. Refactored version override process.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Adjusted the override reference.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Fixed typo in override job.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Fixed override job.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Fixed override job.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

---------

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
  • Loading branch information
AWSHurneyt authored Jun 14, 2023
1 parent db0354e commit d2e78c5
Showing 1 changed file with 20 additions and 3 deletions.
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

0 comments on commit d2e78c5

Please sign in to comment.