set specific chrome driver versioni for unit test #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |