From 150db6752c60950466042610f521f1ff52f546ac Mon Sep 17 00:00:00 2001 From: NitichaiSawangsai <40546651+NitichaiSawangsai@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:42:20 +0700 Subject: [PATCH] Fix/test run e2e 2024 06 15 (#444) * fix: fixed code not use --- .github/workflows/push-tag-version.yml | 12 ++++--- .github/workflows/test-e2e.yml | 50 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-e2e.yml diff --git a/.github/workflows/push-tag-version.yml b/.github/workflows/push-tag-version.yml index 008c6e8..35deeca 100644 --- a/.github/workflows/push-tag-version.yml +++ b/.github/workflows/push-tag-version.yml @@ -35,9 +35,13 @@ jobs: pre_release_branches: develop default_bump: patch fetch_all_tags: true - - - - + tag_prefix: 'tag-' + # - name: Create a GitHub Tag version + # uses: ncipollo/release-action@v1 + # with: + # tag: ${{ steps.tag_version.outputs.new_tag }} + # name: Release ${{ steps.tag_version.outputs.new_tag }} + # body: ${{ steps.tag_version.outputs.changelog }} + diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml new file mode 100644 index 0000000..cceac99 --- /dev/null +++ b/.github/workflows/test-e2e.yml @@ -0,0 +1,50 @@ +name: End-to-end test + +on: + push: + branches: + - release + +jobs: + test-e2e: + runs-on: ubuntu-latest + steps: + # action clones the repository into this environment, + # making your code available for the workflow steps that follow. + - name: Checkout Repository B + uses: actions/checkout@v3 + with: + repository: NitichaiSawangsai/cypress-ex1 # เปลี่ยนเป็น repository ของคุณ + ref: release # ตรวจสอบจาก branch release + # token: ${{ secrets.REPO_B_ACCESS_TOKEN }} # ใช้ Personal Access Token ที่มีสิทธิ์ในการอ่าน Repository B + + - name: Install Dependencies + run: npm install # ติดตั้ง dependencies ของ Cypress + + - name: Run E2E Tests with Cypress + run: npm run cy:run # แก้ตามคำสั่งที่ใช้ใน Repository B สำหรับรัน Cypress tests + + # Install NPM dependencies, cache them correctly + # and run all Cypress tests + # https://github.com/cypress-io/github-action + - name: Cypress run + uses: cypress-io/github-action@v5 + # after the test run completes + # store videos and any screenshots + # NOTE: screenshots will be generated only if E2E test failed + # thus we store screenshots only on failures + # Alternative: create and commit an empty cypress/screenshots folder + # to always have something to upload + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots + # Test run video was always captured, so this action uses "always()" condition + - uses: actions/upload-artifact@v3 + if: always() + with: + name: cypress-videos + path: cypress/videos + +