Skip to content

Commit

Permalink
added github actions for tests with test status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
SparrowSurya committed Aug 21, 2024
1 parent 62e8603 commit 4e4ed65
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: tests

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

permissions:
contents: read

env:
ENV_NAME: testing
BASE_URL: 127.0.0.1:8000
DB_URL: sqlite:///./db.sqlite3
INTERVAL: 3600

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Test api
run: python -m unittest discover
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Pastebin
A fastapi service for code sharing.

![Tests](https://github.com/sparrowsurya/pastebin-api/actions/workflows/tests.yaml/badge.svg)

## TODOS
* logger
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"watchfiles==0.23.0",
"websockets==12.0"
]
requires-python = ">= 3.11"
requires-python = ">= 3.9"
readme = "README.md"
license = { name = "MIT License" }

Expand Down

0 comments on commit 4e4ed65

Please sign in to comment.