ci/cd Fix perms issues (again) and optimize some things in test core linux

This commit is contained in:
Théophile Diot 2023-09-18 18:15:02 +02:00
parent dd0c4c93a6
commit d0a1aab15c
No known key found for this signature in database
GPG Key ID: 248FEA4BAE400D06
1 changed files with 22 additions and 13 deletions

View File

@ -22,6 +22,20 @@ jobs:
with:
python-version: "3.11"
cache: "pip"
- name: Install Firefox
uses: nick-fields/retry@v2
with:
max_attempts: 5
retry_on: error
timeout_seconds: 5
command: |
sudo apt update
sudo apt install -y firefox curl grep zip wget
GECKODRIVER_VERSION=`curl -i https://github.com/mozilla/geckodriver/releases/latest | grep -Po 'v[0-9]+\.[0-9]+\.[0-9]+'` && \
wget -O geckodriver.tar.gz -w 5 https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
sudo tar -C /usr/local/bin -xzvf geckodriver.tar.gz && \
sudo chmod +x /usr/local/bin/geckodriver && \
rm geckodriver.tar.gz
- name: Login to ghcr
uses: docker/login-action@v3
with:
@ -37,24 +51,17 @@ jobs:
docker rm "$container_id"
- name: Install BunkerWeb
run: |
# Install NGINX
sudo apt update
sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install -y nginx=1.24.0-1~jammy
# Install BunkerWeb
echo "force-bad-version" | sudo tee -a /etc/dpkg/dpkg.cfg
sudo apt install -fy /tmp/bunkerweb.deb
- name: Install Firefox
run: |
sudo apt install -y firefox curl grep zip wget
GECKODRIVER_VERSION=`curl -i https://github.com/mozilla/geckodriver/releases/latest | grep -Po 'v[0-9]+\.[0-9]+\.[0-9]+'` && \
wget -O geckodriver.tar.gz -w 5 https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
sudo tar -C /usr/local/bin -xzvf geckodriver.tar.gz && \
sudo chmod +x /usr/local/bin/geckodriver && \
rm geckodriver.tar.gz
- name: Fix version without a starting number
if: inputs.RELEASE == 'testing' || inputs.RELEASE == 'dev'
run: echo "force-bad-version" | sudo tee -a /etc/dpkg/dpkg.cfg
- name: Install BunkerWeb
run: sudo apt install -fy /tmp/bunkerweb.deb
- name: Edit configuration files
run: |
echo "www.example.com 127.0.0.1" | sudo tee -a /etc/hosts
@ -64,10 +71,12 @@ jobs:
echo "HTTP_PORT=80" | sudo tee -a /etc/bunkerweb/variables.env
echo "HTTPS_PORT=443" | sudo tee -a /etc/bunkerweb/variables.env
echo "DNS_RESOLVERS=9.9.9.9 8.8.8.8 8.8.4.4" | sudo tee -a /etc/bunkerweb/variables.env
echo "USE_BUNKERNET=no" | sudo tee -a /etc/bunkerweb/variables.env
echo "USE_BLACKLIST=no" | sudo tee -a /etc/bunkerweb/variables.env
sudo chown nginx:nginx /etc/bunkerweb/variables.env
sudo chmod 777 /etc/bunkerweb/variables.env
- name: Run tests
run: |
cd ./tests/core/${{ inputs.TEST }}
MAKEFLAGS="-j $(nproc)" find . -name "requirements.txt" -exec pip install -r {} \;
MAKEFLAGS="-j $(nproc)" find . -name "requirements.txt" -exec sudo pip install -r {} \;
sudo ./test.sh "linux"