Automated Test Run on Pull Request Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Setting Up Automated Test Execution on Pull Request

Auto-run tests on PR—basic protection against regressions. A developer cannot merge code that breaks existing functionality. This is not a replacement for code review, but its supplement: reviewer focuses on logic, not catching obvious bugs.

Pipeline Structure

A well-structured pipeline is split into parallel jobs with fail-fast strategy:

# .github/workflows/pr.yml
name: PR Tests
on:
  pull_request:
    branches: [main, develop]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true  # Cancel old runs on new push

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci
      - run: npm run lint && npm run type-check

  unit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci
      - run: npm test -- --coverage
      - uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}

  integration:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_DB: testdb
          POSTGRES_PASSWORD: test
        options: >-
          --health-cmd pg_isready
          --health-interval 5s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci
      - run: npm run test:integration
        env:
          DATABASE_URL: postgresql://postgres:test@localhost:5432/testdb

Dependency Caching

# Cache node_modules by package-lock.json
- uses: actions/setup-node@v4
  with:
    node-version: 20
    cache: npm  # Built-in cache in actions/setup-node

# Or explicit via actions/cache
- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

Without cache npm ci on cold runner—60–90 seconds. With cache—5–10 seconds.

Test Matrix

If the application must work on multiple versions of Node.js or PHP:

strategy:
  matrix:
    node-version: [18, 20, 22]
  fail-fast: false  # Run all versions even if one fails

PHP / Laravel

- name: Run PHPUnit
  run: php artisan test --parallel --coverage-clover=coverage.xml
  env:
    DB_CONNECTION: pgsql
    DB_DATABASE: testing

- name: Upload coverage
  uses: codecov/codecov-action@v4
  with:
    files: coverage.xml

--parallel runs tests in parallel via brianium/paratest. On 200+ tests speeds up 3–4 times.

Status Checks and Branch Protection

In GitHub Settings → Branches → Branch protection rules add required status checks: lint, unit, integration. Merge to main without passing these checks is impossible.

Speed Optimization

  • Path filtering—run tests only when relevant files change
  • Test splitting—distribute tests across multiple runners (GitHub Actions matrix)
  • Only changed modules—Jest --changedSince, pytest --testpaths

Goal: pipeline fits in 5 minutes. Slower—developers start ignoring it.

Timeline

Setting up basic pipeline with unit and integration tests for Node.js or PHP project—1–2 days. Setting up coverage reports and badge in README—0.5 days.