-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from rajadilipkolli/main
Fix Edge cases, adds workflows and updates dependencies
- Loading branch information
Showing
34 changed files
with
4,640 additions
and
1,711 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Python 3", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"Vue.volar", | ||
"ms-python.debugpy" | ||
] | ||
} | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/devcontainers/features/node:1": {} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [5050, 8000] | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "pip3 install --user -r requirements.txt", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Django Tests CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- "api/**" | ||
branches: [ main ] | ||
pull_request: | ||
paths: | ||
- "api/**" | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
build: | ||
name: Run Unit & Integration Tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: "./api" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Install Required softwares | ||
run: | | ||
cd .. | ||
docker compose up -d timedb cache | ||
sleep 5 | ||
docker ps -a | ||
- name: Test | ||
env: | ||
SECRET_KEY: '%k8!x4pm=mf!iqz^jws)ijn=)-md-uf_i=^mya1t*d!4f#^74k' | ||
DATABASE_URL: psql://postgres:foliop4sswd@127.0.0.1:15432/folioman | ||
CACHE_URL: rediscache://localhost:16379/1?client_class=django_redis.client.DefaultClient&timeout=86400 | ||
CELERY_BROKER_URL: redis://localhost:16379/3 | ||
CELERY_RESULT_BACKEND: redis://localhost:16379/5 | ||
QUANDL_API_KEY: PUT_QUANDL_API_HERE | ||
ENVIRONMENT: dev | ||
run: python manage.py test folioman.tests mutualfunds.tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Nuxt Build CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- "ui/**" | ||
branches: [ main ] | ||
pull_request: | ||
paths: | ||
- "ui/**" | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
build: | ||
name: Run Unit & Integration Tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: "./ui" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "16" | ||
- name: RUN build | ||
run: | | ||
yarn install | ||
yarn run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
vscode: | ||
extensions: | ||
- ms-python.python | ||
- Vue.volar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Django", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"args": [ | ||
"runserver" | ||
], | ||
"django": true, | ||
"autoStartBrowser": false, | ||
"program": "${workspaceFolder}/api/manage.py" | ||
}, | ||
{ | ||
"name": "Celery", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "celery", | ||
"console": "integratedTerminal", | ||
"cwd": "${workspaceFolder}/api", | ||
"args": [ | ||
"-A", | ||
"taskman", | ||
"worker", | ||
"-l", | ||
"info", | ||
"-P", | ||
"solo", | ||
] | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Celery and Django", | ||
"configurations": ["Celery", "Django"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
## Start in local | ||
|
||
assuming python is installed, open code in Visual Studio Code, right-click and select 'Run Python'. | ||
|
||
This will prompt you to create a virtual environment, select `.venv`, and install all required software. | ||
|
||
then open the terminal and issue the command below to set up lookup data | ||
|
||
```shell | ||
python manage.py migrate | ||
``` | ||
|
||
Issue below command to start local server | ||
|
||
```shell | ||
python manage.py runserver | ||
``` | ||
|
||
## How to update the dependencies in virtual environment | ||
|
||
```shell | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Running the Celery worker | ||
In the new terminal tab, run the following command: | ||
|
||
```shell | ||
celery -A taskman worker -l info -P solo | ||
``` | ||
|
||
where celery is the version of Celery, with the -A option to specify the celery instance to use (in our case, it's celery in the app.py file, so it's taskman), and worker is the subcommand to run the worker, and --loglevel=info to set the verbosity log level to INFO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.