Skip to content

Commit

Permalink
Add github actions poetry test and format stages
Browse files Browse the repository at this point in the history
  • Loading branch information
san99tiago committed Aug 28, 2023
1 parent 2da3688 commit 08dc604
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 707 deletions.
47 changes: 41 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build FastAPI Docker Image and Push to DockerHub
name: FastAPI Docker Image Test, Build and Push to DockerHub

on:
push:
Expand All @@ -7,19 +7,54 @@ on:
branches: [ "main" ]

jobs:

code-quality:
runs-on: ubuntu-latest
name: Check coding standards
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry

- name: Install Python dependencies
run: poetry install

- name: Check code formatting
run: poetry run poe black-format


test:
needs: code-quality
runs-on: ubuntu-latest
name: Run tests
steps:
- name: Check out repo
uses: actions/checkout@v3
# TODO: Add testing
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run poe test-unit

docker:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down
Loading

0 comments on commit 08dc604

Please sign in to comment.