Skip to content

Commit

Permalink
feat: implement CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jamoqs committed Nov 3, 2023
1 parent 423b215 commit b152db0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Django CI Nau Financial Manager

on:
push:
branches: [ 85-add-continuous-integration-with-github-actions ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Poetry
run: make install-poetry install-packages

- name: Get all containers up and running
run: cp sample-dev.env .env; make hr-docker

- name: Run Django tests
run: make test

- name: Run pre-commit checks
run: make pre-commit
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Variables
PYTHON_PATH_ENV_APP=$(shell which python)
POETRY = poetry
SRC_DIR = src
TEST_DIR = tests
POETRY_RUN = poetry run
Expand Down Expand Up @@ -95,3 +96,13 @@ hr-docker: ## remake complete docker environment (destroy dockers, prune docker,
create-token: ## create token for admin user
$(CREATE_TOKEN)
.PHONY: create-token

install-poetry: ## Install Poetry
@echo "Installing Poetry..."
@curl -sSL https://install.python-poetry.org | python -
.PHONY: install-poetry

install-packages: ## Install project dependencies
@echo "Installing project dependencies..."
@$(POETRY) install
.PHONY: install-packages
2 changes: 1 addition & 1 deletion sample-dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MYSQL_USER=nau_user
MYSQL_USER_ROOT=root
MYSQL_PASSWORD=nau_password
MYSQL_ROOT_PASSWORD=nau_password
DB_HOST=database
DB_HOST=127.0.0.1
DB_PORT=3306

SWAGGER_PROJECT_NAME=Nau Financial Manager
Expand Down

0 comments on commit b152db0

Please sign in to comment.