-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (74 loc) · 2.42 KB
/
build.yml
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
79
80
81
82
83
84
name: build
on:
pull_request:
push:
branches: [main]
jobs:
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# - name: Install depedencies
# run: |
# pip install poetry
# poetry install --no-ansi
# - uses: pre-commit/[email protected]
# API-tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# - name: Install depedencies
# run: |
# pip install poetry
# poetry install --no-ansi
# - name: unit tests
# run: |
# poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml
UI-tests:
runs-on: ubuntu-latest
services:
webserver:
image: selenium/standalone-chrome:124.0
ports:
- 4444:4444
options: --shm-size=2gb
env:
SE_NODE_MAX_SESSIONS: 12
SE_NODE_SESSION_TIMEOUT: 300
SCREEN_WIDTH: 1366
SCREEN_HEIGHT: 768
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install depedencies
run: |
pip install poetry
poetry install --no-ansi
# - name: Install Google Chrome and ChromeDriver
# run: |
# sudo apt-get update
# sudo apt-get install -y wget
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo apt install -y ./google-chrome-stable_current_amd64.deb
# wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip
# unzip chromedriver_linux64.zip
# sudo mv chromedriver /usr/local/bin/chromedriver
# sudo chmod +x /usr/local/bin/chromedriver
- name: wait_for_selenium
# retry connection every 5s x 60 which is a total of 5 minutes
run: curl --retry 10 --retry-delay 2 --retry-connrefused http://localhost:4444
- name: UI tests
# env:
# COVERAGE_PROCESS_START: pyproject.toml
run: |
poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444
env:
SE_NODE_MAX_SESSIONS: 12
SE_NODE_SESSION_TIMEOUT: 300
SCREEN_WIDTH: 1366
SCREEN_HEIGHT: 768
DISPLAY: :99 # Needed for headless mode
SELENIUM_HOST: localhost
SELENIUM_PORT: 4444