-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 3.01 KB
/
ci.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
85
86
87
88
89
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10, 3.11]
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox-travis flake8 tox pytest pytest-cov coveralls
pip install dash-bootstrap-components dash[testing] webdriver_manager selenium
pip install --upgrade setuptools importlib-metadata
pip install -e .
- name: Install Chrome and dependencies
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable libnss3 xvfb
# - name: Install Chromedriver
# run: |
# wget http://chromedriver.storage.googleapis.com/106.0.5249.61/chromedriver_linux64.zip
# unzip chromedriver_linux64.zip
# sudo mv chromedriver /usr/local/bin/chromedriver
# sudo chmod +x /usr/local/bin/chromedriver
# - name: Install Chromedriver using webdriver-manager
# run: |
# pip install webdriver-manager
# python -c "from webdriver_manager.chrome import ChromeDriverManager; print(ChromeDriverManager().install())"
- name: Install Specific Version of Google Chrome and Chromedriver
run: |
# Define specific versions
CHROME_VERSION="116.0.5845.111" # Replace with a desired Chrome version
CHROMEDRIVER_VERSION="116.0.5845.96" # Corresponding Chromedriver version
# Install specific version of Google Chrome
sudo apt-get update
wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb
sudo dpkg -i google-chrome-stable_${CHROME_VERSION}-1_amd64.deb || sudo apt-get -f install -y
# Validate Chrome installation
google-chrome --version
# Install specific version of Chromedriver
wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver
# Validate Chromedriver installation
chromedriver --version
- name: Run tests with coverage
env:
DISPLAY: :99.0
run: |
Xvfb :99 & sleep 3
pytest --cov=vital_sqi --cov-report=xml --cov-report=term-missing tests
- name: Upload to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
coveralls-endpoint: https://coveralls.io
path-to-lcov: ./tests # Adjust if necessary