Framework Architecture & CI/CD · Lesson 4 of 6

CI with GitHub Actions: Run UI + API on Every Push

A framework nobody runs is dead code. CI fixes that — it runs your tests automatically on every push, so problems show up in minutes instead of sprints.

By Shahriyar · Updated

The idea, in one line

CI is a robot that runs your test suites for you every time code changes. With GitHub Actions you describe that robot in a YAML file under .github/workflows/.

The words to know

▸ try it
name: tests
on:
  push:
  pull_request:

jobs:
  api:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install -r requirements.txt
      - run: pytest tests/api --alluredir=allure-results
      - uses: actions/upload-artifact@v4
        if: always()               # upload even when tests fail
        with:
          name: allure-api
          path: allure-results

  ui:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        browser: [chromium, firefox]   # fan out across browsers
    steps:
      - uses: actions/checkout@v4
      - run: pytest tests/ui --browser=${{ matrix.browser }}

Read it top to bottom: two jobs, api and ui, run side by side. The api job installs Python, runs the API tests, and saves the report. The ui job runs its tests once per browser.

Advanced — two touches that mark a senior

Grounded in the official GitHub Actions workflow-syntax docs and the actions/upload-artifact README

All lessons in Framework Architecture & CI/CD

  1. Designing a Framework from Scratch: The Layers
  2. The Four Patterns SDETs Actually Use
  3. Test Data: Fixtures vs Factories vs Seeding
  4. CI with GitHub Actions: Run UI + API on Every Push
  5. Docker & Selenium Grid: Reproducible Test Environments
  6. Parallel, Retries & Flaky-Test Quarantine