feat(tools): upd CI (77) #749
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: [ master, CI ] | |
pull_request: | |
branches: [ master, CI ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
container: | |
image: docker.io/library/ubuntu:20.04 # Публичный образ Ubuntu 20.04 из Docker Hub | |
steps: | |
- name: Install Git | |
run: | | |
echo '*** Install Git ***' | |
apt-get update | |
apt-get install -y git | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set up git | |
run: | | |
git config --global --add safe.directory /__w/veda/veda | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI" | |
- name: Verify git status | |
run: | | |
git status | |
git rev-parse HEAD | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Set up non-interactive apt | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | |
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime | |
echo "Etc/UTC" > /etc/timezone | |
- name: Install | |
run: | | |
apt-get clean | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y sudo | |
apt-get install -y dpkg | |
npm install -g testcafe | |
sudo apt-get install -y nodejs npm | |
npm install -g npm | |
./tools/install-tarantool.sh | |
./control-install.sh | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Install latest Firefox | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y software-properties-common | |
sudo add-apt-repository ppa:mozillateam/ppa | |
sudo apt-get update | |
sudo apt-get install -y firefox | |
sudo apt-get install -y dbus-x11 libasound2 | |
sudo apt-get install -y xvfb | |
Xvfb :99 -screen 0 1024x768x24 & | |
export DISPLAY=:99 | |
- name: Create user and configure sudo without password | |
run: | | |
sudo useradd -m testuser | |
echo 'testuser ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/testuser | |
sudo chown -R testuser:testuser /github/home | |
- name: Install and run Firefox | |
run: | | |
sudo -u testuser sudo apt-get install -y firefox | |
sudo -u testuser firefox --version | |
- name: Install TestCafe globally | |
run: | | |
sudo npm install -g testcafe | |
- name: Environment Info | |
run: | | |
rustc -V | |
echo "Node version: $(node -v)" | |
echo "NPM version: $(npm -v)" | |
echo "TestCafe version: $(testcafe -v)" | |
echo "Firefox version: $(firefox --no-sandbox --version)" | |
echo "System info: $(uname -a)" | |
echo "Free memory: $(free -m)" | |
sudo -u testuser testcafe -v | |
- name: Build | |
run: | | |
export CARGO_TARGET_DIR=$HOME/target | |
./build.sh | |
- name: Run Veda | |
run: | | |
# Запускаем скрипт | |
./control-start.sh | |
sleep 240 | |
- name: Run tests | |
run: | | |
cd ./source-web | |
TESTCAFE_DEBUG=true npm run test-backend | |
echo "Backend tests completed" | |
TESTCAFE_DEBUG=true npm run test-frontend | |
echo "Frontend tests completed" | |
cd .. | |
- name: Print logs | |
run: | | |
# Выводим логи | |
tail -n +1 ./data/tarantool/tarantool.log | |
tail -n +1 ./logs/*.log |