-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.22 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Playwright - Pytest automation suite
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pip install poetry
- name: Cache Poetry Virtualenv
id: cache-poetry
uses: actions/cache@v4
with:
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
- name: Install Dependencies
run: poetry install --no-interaction
- name: Install Playwright Browsers
run: poetry run playwright install --with-deps
- name: Install Java (JDK 11)
run: |
sudo apt update
sudo apt install -y openjdk-11-jdk
JAVA_HOME=$(readlink -f $(which java) | sed "s:bin/java::")
echo "JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV
echo "${JAVA_HOME}/bin" >> $GITHUB_PATH
- name: Verify JAVA_HOME and Java Installation
run: |
echo "JAVA_HOME is set to: $JAVA_HOME"
java -version
- name: Install Allure CLI
run: |
version=$(curl -s https://api.github.com/repos/allure-framework/allure2/releases/latest | jq -r '.tag_name')
wget https://github.com/allure-framework/allure2/releases/download/${version}/allure-${version}.tgz
tar -xvzf allure-${version}.tgz
sudo mv allure-${version} /opt/allure
sudo ln -s /opt/allure/bin/allure /usr/local/bin/allure
- name: Run Tests and Generate Allure Report
run: |
poetry run pytest --alluredir=allure-results
mkdir -p allure-report
poetry run allure generate allure-results -o allure-report --clean
- name: Deploy Allure Report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./allure-report
keep_files: true # Keeps old files instead of deleting them