diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b4811b80..49be021f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,34 +1,24 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the master branch push: branches: [ master, CI1 ] pull_request: branches: [ master, CI1 ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-22.04 - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: '20' - # Install + # Install dependencies and other required software - name: Install run: | sudo apt-get clean @@ -36,27 +26,25 @@ jobs: sudo apt-get install dpkg sudo apt-get install firefox npm install -g testcafe - # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - # sudo dpkg -i --force-depends google-chrome-stable_current_amd64.deb ./tools/install-tarantool.sh ./control-install.sh source $HOME/.cargo/env - # Print versions + # Print versions for debugging - name: Print versions run: | node --version testcafe --version rustc -V - # Build + # Build the project - name: Build run: | source $HOME/.cargo/env export CARGO_TARGET_DIR=$HOME/target ./build.sh - # Test + # Run tests - name: Test run: | ./control-start.sh @@ -64,3 +52,14 @@ jobs: tail -n +1 ./data/tarantool/tarantool.log tail -n +1 ./logs/*.log cd ./source-web && npm test + # Добавим шаг для продолжения работы при сбое тестов + continue-on-error: true + + # Загружаем скриншоты как артефакты (если они есть) + - name: Upload TestCafe screenshots + if: failure() # Выполняется только при сбое тестов + uses: actions/upload-artifact@v3 + with: + name: testcafe-screenshots + path: ./source-web/screenshots/ # Путь к папке с сохраненными скриншотами + diff --git a/source-web/package.json b/source-web/package.json index f1bfc04b6..73794071d 100644 --- a/source-web/package.json +++ b/source-web/package.json @@ -83,7 +83,7 @@ "scripts": { "test": "npm run test-backend && npm run test-frontend", "test-backend": "node ./tests/backend/index.js", - "test-frontend": "testcafe --skip-js-errors --speed 0.1 chromium:headless ./tests/testcafe", + "test-frontend": "testcafe --screenshots-on-fails --screenshots-path ./screenshots chromium:headless ./tests/testcafe", "build": "npm run clean && npm run build-browser-scripts && npm run build-templates && npm run build-server-scripts && npm run update-version", "clean": "find ../public/* ! -name \"ontology.json*\" -delete 2>/dev/null || true", "build-browser-scripts": "babel --config-file ./.babelrc . --out-dir ../public --copy-files",