Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: API Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: uv sync

- name: Run tests
run: uv run pytest -v

- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: .pytest_cache/
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Python API Testing - JSONPlaceholder

![API Tests](https://github.com/vernko/python-api-testing-jsonplaceholder/actions/workflows/api-tests.yml/badge.svg)

REST API test automation suite using Python, pytest, and requests library. Tests the JSONPlaceholder fake REST API to demonstrate API testing skills.

## Setup
Expand All @@ -20,6 +22,23 @@ uv run pytest -v
uv run pytest tests/test_posts.py -v
```

## CI/CD

This project uses GitHub Actions for continuous integration. Tests run automatically on:
- Every push to `main` branch
- Every pull request to `main` branch

### Workflow Details

The CI pipeline:
1. Sets up Python 3.9 environment
2. Installs `uv` package manager
3. Installs project dependencies
4. Runs all tests with pytest
5. Uploads test results as artifacts on failure

See `.github/workflows/api-tests.yml` for full workflow configuration.

## Project Structure
```
tests/
Expand Down