Skip to content

Commit

Permalink
Parallel workflow setup 1
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Dec 8, 2023
1 parent d141d59 commit da6c27d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/integration-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ env:
OPENSEARCH_PLUGIN_VERSION: '3.0.0.0'

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate test files list
id: set-matrix
run: |
TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | sed 's/.spec.js//; s/.spec.ts//')
TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n")[:-1]')
echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES_JSON}"
tests:
env:
# Prevents extra Cypress installation progress messages
Expand All @@ -23,10 +38,10 @@ jobs:
matrix:
os: [ubuntu-latest]
java: [11]
testfiles: ${{ fromJson(needs.prepare-matrix.outputs.matrix).testfiles }}
include:
- os: ubuntu-latest
cypress_cache_folder: ~/.cache/Cypress

runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -153,7 +168,7 @@ jobs:
- name: Run Cypress tests
run: |
cd ./OpenSearch-Dashboards/plugins/dashboards-observability
yarn cypress:parallel --browser chrome
yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testfiles }}'
- name: Capture failure screenshots
uses: actions/upload-artifact@v1
Expand Down

0 comments on commit da6c27d

Please sign in to comment.