Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Koaha committed Nov 25, 2024
1 parent b461e59 commit b4a917f
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,28 @@ jobs:
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: Set up Google Chrome
- name: Install Google Chrome
run: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install google-chrome-stable libnss3 xvfb
sudo apt-get install -y google-chrome-stable
google-chrome --version || echo "Google Chrome installation failed."
- name: Install ChromeDriver
run: |
CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+\.\d+')
CHROMEDRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION)
wget -N 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
if command -v google-chrome &> /dev/null; then
CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+\.\d+')
echo "Detected Chrome version: $CHROME_VERSION"
CHROMEDRIVER_VERSION=$(curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$(echo $CHROME_VERSION | cut -d. -f1))
wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip || echo "Failed to fetch ChromeDriver."
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver
else
echo "Google Chrome is not installed."
exit 1
fi
- name: Run tests with coverage
env:
Expand Down

0 comments on commit b4a917f

Please sign in to comment.