update github yaml

This commit is contained in:
shao.xiaoping 2024-01-22 15:45:27 +08:00
parent 4b581e083c
commit 48ba0f8bdc
2 changed files with 16 additions and 4 deletions

View File

@ -37,3 +37,18 @@ jobs:
- run: pipenv run python -m playwright install - run: pipenv run python -m playwright install
- name: Run test cases and generate report - name: Run test cases and generate report
run: pipenv run python run.py run: pipenv run python run.py
- name: Build test report
uses: simple-elf/allure-report-action@v1.7
if: always()
with:
allure_results: temp
allure_history: report
- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: main
publish_dir: report

View File

@ -32,10 +32,7 @@ def generate_allure_report():
allure_pkg = os.path.join(cm.base_dir, 'allure', 'bin', 'allure.bat') allure_pkg = os.path.join(cm.base_dir, 'allure', 'bin', 'allure.bat')
win_cli = '{} generate {} -o {} --clean'.format(allure_pkg, test_result, test_report) win_cli = '{} generate {} -o {} --clean'.format(allure_pkg, test_result, test_report)
log.info(os.popen(win_cli).read()) log.info(os.popen(win_cli).read())
# elif get_sys() == 'linux': else:
# linux_cli = 'allure generate {} -o {} --clean'.format(test_result, test_report)
# log.info(os.popen(linux_cli).read())
else: # Mac
allure_pkg = os.path.join(cm.base_dir, 'allure', 'bin', 'allure') allure_pkg = os.path.join(cm.base_dir, 'allure', 'bin', 'allure')
mac_cli = 'chmod a+x %s;%s generate %s -o %s --clean' % (allure_pkg, allure_pkg, test_result, test_report) mac_cli = 'chmod a+x %s;%s generate %s -o %s --clean' % (allure_pkg, allure_pkg, test_result, test_report)
log.info(os.popen(mac_cli).read()) log.info(os.popen(mac_cli).read())