Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflow files to use playwright and update branch name #1619

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/add_issue_to_triage_board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:
- opened
jobs:
add-to-triage-project-board:
uses: cypress-io/cypress/.github/workflows/triage_add_to_project.yml@develop
secrets: inherit
uses: cypress-io/cypress/.github/workflows/triage_add_to_project.yml@master
secrets: inherit
226 changes: 0 additions & 226 deletions .github/workflows/main.yml

This file was deleted.

28 changes: 14 additions & 14 deletions .github/workflows/merge-develop-into-flake-demo.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Merge develop into flake-demo
name: Merge master into flake-demo
on:
push:
branches:
- develop
- master
jobs:
merge-master-into-develop:
merge-master-into-flake-demo:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -19,24 +19,24 @@ jobs:
run: git checkout flake-demo
- name: Check for merge conflict
id: check-conflict
run: echo "name=merge_conflict::$(git merge-tree $(git merge-base HEAD develop) develop HEAD | egrep '<<<<<<<')" >> $GITHUB_OUTPUT
- name: Merge develop into flake-demo
run: git merge develop
run: echo "name=merge_conflict::$(git merge-tree $(git merge-base HEAD master) master HEAD | egrep '<<<<<<<')" >> $GITHUB_OUTPUT
- name: Merge master into flake-demo
run: git merge master
if: ${{ !steps.check-conflict.outputs.merge_conflict }}
- name: Push
run: git push
if: ${{ !steps.check-conflict.outputs.merge_conflict }}
- name: Checkout develop
run: git checkout develop
- name: Checkout master
run: git checkout master
if: ${{ steps.check-conflict.outputs.merge_conflict }}
- name: Determine name of new branch
id: gen-names
run: |
echo "name=sha::$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "name=branch_name::$(git rev-parse --short HEAD)-develop-into-flake-demo" >> $GITHUB_OUTPUT
echo "name=branch_name::$(git rev-parse --short HEAD)-master-into-flake-demo" >> $GITHUB_OUTPUT
if: ${{ steps.check-conflict.outputs.merge_conflict }}
- name: Create a copy of develop on a new branch
run: git checkout -b ${{ steps.gen-names.outputs.branch_name }} develop
- name: Create a copy of master on a new branch
run: git checkout -b ${{ steps.gen-names.outputs.branch_name }} master
if: ${{ steps.check-conflict.outputs.merge_conflict }}
- name: Push branch to remote
run: git push origin ${{ steps.gen-names.outputs.branch_name }}
Expand All @@ -50,8 +50,8 @@ jobs:
repo: context.repo.repo,
base: 'flake-demo',
head: '${{ steps.gen-names.outputs.branch_name }}',
title: 'chore: merge develop (${{ steps.gen-names.outputs.sha }}) into flake-demo',
body: `There was a merge conflict when trying to automatically merge develop into flake-demo. Please resolve the conflict and complete the merge.
title: 'chore: merge master (${{ steps.gen-names.outputs.sha }}) into flake-demo',
body: `There was a merge conflict when trying to automatically merge master into flake-demo. Please resolve the conflict and complete the merge.

DO NOT SQUASH AND MERGE

Expand All @@ -70,4 +70,4 @@ jobs:
issue_number: pull.data.number,
labels: ['auto-merge'],
})
if: ${{ steps.check-conflict.outputs.merge_conflict }}
if: ${{ steps.check-conflict.outputs.merge_conflict }}
83 changes: 83 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Playwright Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:

jobs:
test:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shards: [1, 2, 3]
browser: [chromium, firefox]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install Playwright browser
run: npx playwright install --with-deps ${{ matrix.browser }}

- name: Install Allure
run: npm i -g allure-commandline

- name: Run tests
run: |
npx playwright test \
--shard=${{ matrix.shards }}/3 \
--project=${{ matrix.browser }} \
--reporter=list,allure-playwright

- name: Generate Allure report
if: always()
run: |
allure generate allure-results -o allure-report/${{ matrix.browser }}-${{ matrix.shards }} --clean

- name: Store report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-report
path: allure-report
retention-days: 14

- name: Store traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: traces-${{ matrix.browser }}-${{ matrix.shards }}
path: test-results
retention-days: 7

publish-report:
if: always()
needs: [test]
runs-on: ubuntu-latest

steps:
- name: Download reports
uses: actions/download-artifact@v4
with:
name: allure-report
path: allure-report

- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: allure-report
4 changes: 2 additions & 2 deletions .github/workflows/triage_new_comment_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ on:
- created
jobs:
closed-issue-comment:
uses: cypress-io/cypress/.github/workflows/triage_handle_new_comments.yml@develop
secrets: inherit
uses: cypress-io/cypress/.github/workflows/triage_handle_new_comments.yml@master
secrets: inherit
Loading