From c06d69cb41128bdc9c57317848d5888c4898b540 Mon Sep 17 00:00:00 2001 From: shaylevi Date: Wed, 10 Jul 2024 12:01:51 +0300 Subject: [PATCH] vp test: adding workflow and action for CI --- .github/actions/node-setup/action.yml | 28 +++++++++++++++++ .github/workflows/e2e_pr.yml | 44 +++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/actions/node-setup/action.yml create mode 100644 .github/workflows/e2e_pr.yml diff --git a/.github/actions/node-setup/action.yml b/.github/actions/node-setup/action.yml new file mode 100644 index 00000000..bc5a4a53 --- /dev/null +++ b/.github/actions/node-setup/action.yml @@ -0,0 +1,28 @@ +name: Node Setup +description: Node Setup + +outputs: + cache-hit: + description: Informing if there has been cache hit on node_modules + value: ${{ steps.node-modules.outputs.cache-hit }} + +runs: + using: composite + steps: + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + + + - name: Synchronize Node Modules cache + id: node-modules + uses: actions/cache@v3 + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + diff --git a/.github/workflows/e2e_pr.yml b/.github/workflows/e2e_pr.yml new file mode 100644 index 00000000..2e9c2fcf --- /dev/null +++ b/.github/workflows/e2e_pr.yml @@ -0,0 +1,44 @@ +name: Video Player PR + +on: + workflow_dispatch: + + +env: + CI: true + +jobs: + + e2e: + name: install + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Node setup + uses: ./.github/actions/node-setup + + - name: Fast Install + uses: npm install + + - name: E2E tests + run: npm run test:e2e + + - name: Upload report to artifact + uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + +# - name: Deploy report to Github Pages +# if: always() +# uses: peaceiris/actions-gh-pages@v3 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# publish_dir: playwright-report + + +