feat(tools): upd CI (66) #738
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 | |
npm install -g npm | |
./tools/install-tarantool.sh | |
./control-install.sh | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
echo "export PATH=$PATH:/usr/local/bin" | sudo tee -a /etc/profile | |
source /etc/profile | |
- 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 | |
- name: Print versions | |
run: | | |
echo "Node version: $(node -v)" | |
echo "NPM version: $(npm -v)" | |
rustc -V | |
- name: Build | |
run: | | |
export CARGO_TARGET_DIR=$HOME/target | |
./build.sh | |
- name: Set up core dump configuration | |
run: | | |
# Создаем директорию для core dumps | |
export COREDUMP_DIR=$GITHUB_WORKSPACE/corefiles | |
mkdir -p $COREDUMP_DIR | |
# Включаем создание core dumps | |
ulimit -c unlimited | |
# Устанавливаем шаблон для имени core dump | |
echo "kernel.core_pattern=${COREDUMP_DIR}/core.%e.%t.%p.%s" | sudo tee /etc/sysctl.d/60-core-pattern.conf | |
sudo sysctl --system | |
- name: Environment Info | |
run: | | |
echo "Node version: $(node -v)" | |
echo "NPM version: $(npm -v)" | |
echo "TestCafe version: $(testcafe -v)" | |
echo "Firefox version: $(firefox --version)" | |
echo "System info: $(uname -a)" | |
echo "Free disk space: $(df -h)" | |
echo "Free memory: $(free -m)" | |
- name: Set up user for tests | |
run: | | |
sudo useradd testuser | |
sudo chown -R testuser:testuser /github/home | |
sudo -u testuser bash -c 'echo "Running as $(whoami)"' | |
- name: Run Veda | |
run: | | |
# Запускаем скрипт | |
./control-start.sh | |
sleep 240 | |
- name: Run tests | |
run: | | |
cd ./source-web | |
sudo -u testuser bash -c 'TESTCAFE_DEBUG=true npm run test-backend' | |
echo "Backend tests completed" | |
sudo -u testuser bash -c '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 |