Skip to content

Commit 7a207c4

Browse files
feat: add workflows
1 parent 1ec008d commit 7a207c4

5 files changed

Lines changed: 82 additions & 5 deletions

File tree

.github/workflows/commit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint Commit Messages
2+
on:
3+
push:
4+
branches: [ master ]
5+
# Remove the line above to run when pushing to master
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
commitlint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- uses: wagoid/commitlint-github-action@v2

.github/workflows/linter.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
###########################
3+
###########################
4+
## Linter GitHub Actions ##
5+
###########################
6+
###########################
7+
name: Lint Code Base
8+
9+
#
10+
# Documentation:
11+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
12+
#
13+
14+
#############################
15+
# Start the job on all push #
16+
#############################
17+
on:
18+
push:
19+
branches: [ master ]
20+
# Remove the line above to run when pushing to master
21+
pull_request:
22+
branches: [ master ]
23+
24+
###############
25+
# Set the Job #
26+
###############
27+
jobs:
28+
build:
29+
# Name the Job
30+
name: Lint Code Base
31+
# Set the agent to run on
32+
runs-on: ubuntu-latest
33+
34+
##################
35+
# Load all steps #
36+
##################
37+
steps:
38+
##########################
39+
# Checkout the code base #
40+
##########################
41+
- name: Checkout Code
42+
uses: actions/checkout@v2
43+
with:
44+
# Full git history is needed to get a proper list of changed files within `super-linter`
45+
fetch-depth: 0
46+
47+
################################
48+
# Run Linter against code base #
49+
################################
50+
- name: Lint Code Base
51+
uses: github/super-linter@v3
52+
env:
53+
VALIDATE_ALL_CODEBASE: true
54+
VALIDATE_MARKDOWN: false
55+
DEFAULT_BRANCH: master
56+
VALIDATE_DOCKERFILE: false
57+
VALIDATE_DOCKERFILE_HADOLINT: false
58+
VALIDATE_PYTHON_FLAKE8: false
59+
VALIDATE_BASH: false
60+
VALIDATE_JSCPD: false
61+
VALIDATE_PYTHON_ISORT: false
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

database/connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from sqlalchemy.ext.declarative import declarative_base
44
from sqlalchemy.orm import sessionmaker
55

6-
# SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
76
SQLALCHEMY_DATABASE_URL = config("DATABASE_URL")
87

98
engine = create_engine(SQLALCHEMY_DATABASE_URL)

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from fastapi import FastAPI
22

3-
from schemas.schemas import HealthResponse
43
from routes.posts import router
4+
from schemas.schemas import HealthResponse
55

66
app = FastAPI()
77

routes/posts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
from typing import List
22

3-
from fastapi import APIRouter, status, Depends, HTTPException
3+
from fastapi import APIRouter, Depends, HTTPException, status
44
from sqlalchemy.orm import Session
55

66
from database.connection import get_db
7-
from schemas.schemas import Post, DeletePostResponse
7+
from schemas.schemas import DeletePostResponse, Post
88
from utils.post_crud import (
99
post_create,
10-
posts_get_all,
1110
post_delete,
1211
post_get_one,
1312
post_update,
13+
posts_get_all,
1414
)
1515

1616
router = APIRouter(tags=["posts"])

0 commit comments

Comments
 (0)