From 74faf05c9b2dd6b6738a5604469c00b1edad3ff0 Mon Sep 17 00:00:00 2001 From: Caesar Kabalan Date: Tue, 15 Oct 2024 00:27:02 -0700 Subject: [PATCH] Update Build Pipeline --- ...er_build_and_push.yml => docker-build.yml} | 18 +++------ .github/workflows/ui-testing.yml | 37 +++++++++++++++++++ 2 files changed, 43 insertions(+), 12 deletions(-) rename .github/workflows/{docker_build_and_push.yml => docker-build.yml} (78%) create mode 100644 .github/workflows/ui-testing.yml diff --git a/.github/workflows/docker_build_and_push.yml b/.github/workflows/docker-build.yml similarity index 78% rename from .github/workflows/docker_build_and_push.yml rename to .github/workflows/docker-build.yml index 57e37f0..5c30e8e 100644 --- a/.github/workflows/docker_build_and_push.yml +++ b/.github/workflows/docker-build.yml @@ -1,4 +1,4 @@ -name: docker +name: Docker Build on: push: @@ -9,30 +9,24 @@ on: env: DOCKERHUB_TAG: ${{ github.ref_name == 'main' && 'latest' || 'develop' }} - jobs: docker: runs-on: ubuntu-latest steps: - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - id: container_name + - id: container_name uses: ASzc/change-string-case-action@v5 with: string: ${{ github.repository_owner }}/${{ github.event.repository.name }} - - - name: Build and push + - name: Build and push uses: docker/build-push-action@v5 with: push: true diff --git a/.github/workflows/ui-testing.yml b/.github/workflows/ui-testing.yml new file mode 100644 index 0000000..a4776a5 --- /dev/null +++ b/.github/workflows/ui-testing.yml @@ -0,0 +1,37 @@ +name: UI Testing (Playwright) +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop +jobs: + test: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: | + cd src/ + npm ci + npm run postinstall + - name: Build + run: | + npm run build + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30