Skip to content

Commit 509e18c

Browse files
committed
ci setup
1 parent 01c04b7 commit 509e18c

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ jobs:
2121
run: |
2222
python -m pip install --upgrade pip
2323
pip install -r requirements.txt
24-
pip install pytest-sugar
25-
pip install pytest-html
24+
pip install allure-pytest
2625
pip install playwright
2726
playwright install
28-
- name: Run tests
27+
28+
- name: Install Allure CLI
2929
run: |
30-
if [ -z "${{ github.event.inputs.test_class }}" ]; then
31-
pytest --maxfail=1 --disable-warnings -q --html=report.html --self-contained-html
32-
else
33-
pytest ${{ github.event.inputs.test_class }} --maxfail=1 --disable-warnings -q --html=report.html --self-contained-html
34-
fi
35-
- name: Upload test report
36-
uses: actions/upload-artifact@v2
30+
wget -qO- https://github.com/allure-framework/allure2/releases/latest/download/allure-2.21.0.zip > allure.zip
31+
unzip allure.zip -d allure
32+
sudo ln -s $PWD/allure/bin/allure /usr/bin/allure
33+
34+
- name: Run tests and generate Allure report
35+
run: ./your-test-script.sh
36+
37+
- name: Upload Allure Report
38+
uses: actions/upload-artifact@v3
3739
with:
38-
name: test-report
39-
path: report.html
40+
name: allure-report
41+
path: allure-report

run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
DEBUG=${DEBUG:-0}
33
ALLURE=${ALLURE:-1}
44

5-
rm -rf allure-results
5+
rm -rf allure-results allure-report
66

77
if [ "$DEBUG" -eq 1 ]; then
88
export PWDEBUG=1
@@ -12,5 +12,7 @@ python -m pytest --alluredir=allure-results "$@"
1212

1313
if [ "$ALLURE" -eq 1 ]; then
1414
allure generate allure-results -o allure-report --clean
15-
allure open allure-report
15+
if [ -z "$CI" ]; then
16+
allure open allure-report
17+
fi
1618
fi

0 commit comments

Comments
 (0)