Skip to content

Commit 40dbaa9

Browse files
committed
Sync auto-copilot-org-playwright-loopv2.yaml from .github repo
1 parent 8bf89d2 commit 40dbaa9

File tree

1 file changed

+5
-142
lines changed

1 file changed

+5
-142
lines changed
Lines changed: 5 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,13 @@
1-
name: "Org-wide: Copilot Playwright Test, Review, Auto-fix, PR, Merge"
1+
name: "DEPRECATED: Copilot Playwright Loop v2 (use .yml)"
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- master
84
workflow_dispatch:
95

10-
permissions:
11-
contents: write
12-
pull-requests: write
13-
issues: write
14-
actions: read
15-
166
jobs:
17-
playwright-review-fix:
7+
deprecated:
188
runs-on: ubuntu-latest
199
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
with:
23-
token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
24-
25-
- name: Setup Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: "3.11"
29-
30-
- name: Check for requirements.txt
31-
id: check-requirements
32-
run: |
33-
if [ -f "requirements.txt" ]; then
34-
echo "requirements_exists=true" >> $GITHUB_OUTPUT
35-
else
36-
echo "requirements_exists=false" >> $GITHUB_OUTPUT
37-
echo "No requirements.txt found, skipping dependency installation"
38-
fi
39-
40-
- name: Install dependencies
41-
if: steps.check-requirements.outputs.requirements_exists == 'true'
42-
run: |
43-
pip install -r requirements.txt
44-
continue-on-error: true
45-
46-
- name: Install Playwright and testing dependencies
47-
run: |
48-
pip install pytest playwright pytest-playwright
49-
continue-on-error: true
50-
51-
- name: Install Playwright browsers
52-
run: |
53-
python -m playwright install --with-deps
54-
continue-on-error: true
55-
56-
- name: Check for tests directory
57-
id: check-tests
58-
run: |
59-
if [ -d "tests" ] || [ -d "test" ] || find . -name "*test*.py" -type f | head -1 | grep -q .; then
60-
echo "tests_exist=true" >> $GITHUB_OUTPUT
61-
echo "Tests found, proceeding with test execution"
62-
else
63-
echo "tests_exist=false" >> $GITHUB_OUTPUT
64-
echo "No tests found, skipping test execution"
65-
fi
66-
67-
- name: Run Playwright Tests
68-
if: steps.check-tests.outputs.tests_exist == 'true'
69-
run: |
70-
# Try different test directory patterns
71-
if [ -d "tests" ]; then
72-
pytest tests/ -v --tb=short
73-
elif [ -d "test" ]; then
74-
pytest test/ -v --tb=short
75-
else
76-
pytest . -k "test" -v --tb=short
77-
fi
78-
continue-on-error: true
79-
80-
- name: Generate test report
81-
if: steps.check-tests.outputs.tests_exist == 'true'
82-
run: |
83-
echo "## Test Results" >> test_report.md
84-
echo "Playwright tests have been executed." >> test_report.md
85-
echo "Check the logs above for detailed results." >> test_report.md
86-
continue-on-error: true
87-
88-
- name: Create Issue for Test Failures
89-
if: failure() && steps.check-tests.outputs.tests_exist == 'true'
90-
uses: actions/github-script@v7
91-
with:
92-
github-token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
93-
script: |
94-
const title = `Playwright Tests Failed - ${new Date().toISOString().split('T')[0]}`;
95-
const body = `
96-
## Playwright Test Failure Report
97-
98-
**Repository:** ${{ github.repository }}
99-
**Branch:** ${{ github.ref_name }}
100-
**Commit:** ${{ github.sha }}
101-
**Workflow Run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
102-
103-
The automated Playwright tests have failed. Please review the workflow logs for details.
104-
105-
### Next Steps:
106-
1. Review the test failures in the workflow logs
107-
2. Fix the failing tests locally
108-
3. Push the fixes to trigger a new test run
109-
110-
This issue was automatically created by the Playwright testing workflow.
111-
`;
112-
113-
// Check if similar issue already exists
114-
const issues = await github.rest.issues.listForRepo({
115-
owner: context.repo.owner,
116-
repo: context.repo.repo,
117-
state: 'open',
118-
labels: ['playwright-failure', 'automated']
119-
});
120-
121-
const existingIssue = issues.data.find(issue =>
122-
issue.title.includes('Playwright Tests Failed') &&
123-
issue.created_at > new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString()
124-
);
125-
126-
if (!existingIssue) {
127-
await github.rest.issues.create({
128-
owner: context.repo.owner,
129-
repo: context.repo.repo,
130-
title: title,
131-
body: body,
132-
labels: ['playwright-failure', 'automated', 'bug']
133-
});
134-
}
135-
continue-on-error: true
136-
137-
- name: Summary
10+
- name: Notice
13811
run: |
139-
echo "## Playwright Workflow Summary" >> $GITHUB_STEP_SUMMARY
140-
echo "" >> $GITHUB_STEP_SUMMARY
141-
echo "**Repository:** ${{ github.repository }}" >> $GITHUB_STEP_SUMMARY
142-
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
143-
echo "**Requirements found:** ${{ steps.check-requirements.outputs.requirements_exists }}" >> $GITHUB_STEP_SUMMARY
144-
echo "**Tests found:** ${{ steps.check-tests.outputs.tests_exist }}" >> $GITHUB_STEP_SUMMARY
145-
echo "" >> $GITHUB_STEP_SUMMARY
146-
if [ "${{ steps.check-tests.outputs.tests_exist }}" = "true" ]; then
147-
echo "✅ Playwright tests were executed. Check logs for results." >> $GITHUB_STEP_SUMMARY
148-
else
149-
echo "ℹ️ No tests found - workflow completed successfully without test execution." >> $GITHUB_STEP_SUMMARY
150-
fi
12+
echo "This workflow file is deprecated."
13+
echo "Use auto-copilot-org-playwright-loopv2.yml instead."

0 commit comments

Comments
 (0)