Skip to content

Build gh-pages

Build gh-pages #25

Workflow file for this run

name: playwright-allure-report
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
name: Run end-to-end tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
#!new codee
allure:
name: Generate Allure Report
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@v3
- name: Get Allure history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Allure Report action from marketplace
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages
allure_report: allure-report
#! do I have such a folder?
allure_history: allure-history
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{secrets.GITHUB_TOKEN}}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-report
- name: Add link to branch description
run: |
echo "Allure Report: [GitHub Pages](https://github.com/$GITHUB_REPOSITORY/tree/gh-pages)" >> branch-description.txt
# - name: Post the link to the report
# if: always()
# uses: Sibz/github-status-action@v1
# with:
# authToken: ${{secrets.GITHUB_TOKEN}}
# context: 'Test report'
# state: 'success'
# sha: ${{ github.event.pull_request.head.sha }}
# #! I can only add this link if the website is ready
# # target_url: simple-elf.github.io/github-allure-history/${{ github.run_number }}
# target_url: radomyr-horban.github.io/playwright/${{ github.run_number }}
# - name: Configure Git
# run: |
# git config user.name "Radomyr Horban"
# git config user.email "[email protected]"
# - name: Copy Allure report
# run: |
# mkdir -p allure-results
# cp -r allure-report/* allure-results/
# - name: Create Allure report
# run: allure generate allure-results -o allure-report --clean
# - name: Create and push `allure-report` branch
# run: |
# git checkout -b allure-report
# git add allure-results
# git commit -m "Add Allure report"
# git push origin allure-report