Test integration tests #2520
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: Integration tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- qa/** | |
- stable/** | |
- dev/integration-test-test | |
jobs: | |
integration-tests: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
browser: [Chrome, Electron, Firefox] | |
name: ${{ matrix.browser }} | |
env: | |
COMPOSE_FILE: ${{ github.workspace }}/docker/docker-compose.dev.yml | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Start containerized services | |
run: | | |
sudo sysctl -w vm.max_map_count=262144 | |
docker compose up -d percona elasticsearch gearmand | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
coverage: none | |
extensions: apcu, opcache | |
- name: Setup PHP-FPM | |
run: | | |
sudo apt install php-fpm | |
sudo service php8.3-fpm start | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/files | |
key: 24.04-8.3-composer-${{ hashFiles('composer.lock') }} | |
- name: Install Composer dependencies | |
run: composer install | |
- name: Cache NPM dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
~/.cache/Cypress | |
key: npm-${{ hashFiles('package-lock.json') }} | |
- name: Install NPM dependencies | |
run: sudo npm install -g npm && npm ci | |
- name: Modify Gearman config | |
run: | | |
echo -e "all:\n servers:\n default: 127.0.0.1:63005" \ | |
> apps/qubit/config/gearman.yml | |
- name: Build themes | |
run: | | |
sudo npm install -g "less@<4.0.0" | |
make -C plugins/arDominionPlugin | |
make -C plugins/arArchivesCanadaPlugin | |
npm run build | |
- name: Run the installer | |
run: | | |
php symfony tools:install \ | |
--database-host=127.0.0.1 \ | |
--database-port=63003 \ | |
--database-name=atom \ | |
--database-user=atom \ | |
--database-password=atom_12345 \ | |
--search-host=127.0.0.1 \ | |
--search-port=63002 \ | |
--search-index=atom \ | |
--demo \ | |
--no-confirmation | |
- name: Change filesystem permissions | |
run: | | |
sudo chown -R www-data:www-data ${{ github.workspace }} | |
sudo chmod 755 /home | |
sudo chmod 755 /home/runner | |
- name: Start application services | |
run: | | |
sudo cp test/etc/fpm_conf /etc/php/8.3/fpm/pool.d/atom.conf | |
sudo rm /etc/php/8.3/fpm/pool.d/www.conf | |
sudo systemctl restart php8.3-fpm | |
sudo php-fpm8.3 --test | |
sudo cp test/etc/worker_conf /usr/lib/systemd/system/atom-worker.service | |
sudo systemctl daemon-reload | |
sudo systemctl start atom-worker | |
- name: Install and configure Nginx | |
run: | | |
sudo apt install nginx | |
sudo cp test/etc/nginx_conf /etc/nginx/sites-available/atom | |
sudo ln -s /etc/nginx/sites-available/atom /etc/nginx/sites-enabled | |
sudo rm -f /etc/nginx/sites-enabled/default | |
sudo nginx -t | |
sudo systemctl restart nginx | |
- name: Create writable Cypress videos and screenshots dirs | |
run: | | |
sudo mkdir -p ${{ github.workspace }}/cypress/screenshots ${{ github.workspace }}/cypress/videos | |
sudo chmod a=rwx ${{ github.workspace }}/cypress/screenshots ${{ github.workspace }}/cypress/videos | |
- name: Run tests | |
env: | |
BROWSER: ${{ matrix.browser }} | |
CYPRESS_VIDEO: false | |
CYPRESS_BASE_URL: http://localhost | |
LIBGL_ALWAYS_SOFTWARE: 1 | |
run: npx cypress run -b ${BROWSER,} | |
- name: Print logs | |
if: failure() | |
run: | | |
echo 'Print qubit_cli.log' | |
sudo tail ${{ github.workspace }}/log/qubit_cli.log | |
echo 'Print qubit_worker.log' | |
sudo tail ${{ github.workspace }}/log/qubit_worker.log | |
echo 'Print qubit_prod.log' | |
sudo tail ${{ github.workspace }}/log/qubit_prod.log | |
echo 'Print nginx/error.log' | |
sudo tail -n 30 /var/log/nginx/error.log | |
echo 'Print php8.3-fpm.log' | |
sudo tail /var/log/php8.3-fpm.log | |
- name: Upload Cypress Screenshots | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots |