From 1bc9f80d40badb143eeb7cce0fc729e82ea8e0a7 Mon Sep 17 00:00:00 2001 From: Johan Compagner Date: Mon, 30 Dec 2024 14:28:51 +0100 Subject: [PATCH] SVY-19813 create cypress component test for bootstrapcomponents added workflow file for executing test after push --- .github/workflows/runTest.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/runTest.yml diff --git a/.github/workflows/runTest.yml b/.github/workflows/runTest.yml new file mode 100644 index 0000000..c896299 --- /dev/null +++ b/.github/workflows/runTest.yml @@ -0,0 +1,47 @@ +name: Run the cypress component tests + +on: + push: + branches: + - master + - 20** + - v20** + workflow_dispatch: + workflow_call: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Find component directory + id: find_component_dir + run: echo "COMPONENT_DIR=$(find . -type d -name 'META-INF' -exec dirname {} \;)" >> $GITHUB_ENV + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + cache: 'npm' + cache-dependency-path: ${{ env.COMPONENT_DIR }}/package-lock.json + + - name: Install and run the cypress component tests + working-directory: ${{ env.COMPONENT_DIR }} + run: | + npm install + npm run cy:run + + - name: Upload artifacts on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-artifacts + path: ${{ env.COMPONENT_DIR }}/cypress/screenshots/** + if-no-files-found: ignore + retention-days: 30 + +