Skip to content

Commit

Permalink
Merge pull request #9 from BurnySc2/develop
Browse files Browse the repository at this point in the history
Merge to master
  • Loading branch information
BurnySc2 authored Mar 3, 2022
2 parents 6310173 + ddab3c7 commit 46ff664
Show file tree
Hide file tree
Showing 144 changed files with 23,676 additions and 52,336 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10']
mongodb-version: [5.0.0]
runs-on: ${{ matrix.os }}

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test_fastapi_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
paths:
- burny_common/**
- fastapi_server/**
- poetry.lock
- .github/workflows/test_fastapi_server.yml
pull_request:
branches:
- master
Expand All @@ -15,11 +17,12 @@ jobs:
test_backend:
env:
SUBDIRECTORY: fastapi_server
DATABASE_PATH: sqlite:///data/sqlmodel.db
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10']
runs-on: ${{ matrix.os }}

steps:
Expand Down
203 changes: 0 additions & 203 deletions .github/workflows/test_react_frontend.yml

This file was deleted.

55 changes: 1 addition & 54 deletions .github/workflows/test_svelte_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- fastapi_server/**
- poetry.lock
- svelte_frontend/**
- .github/workflows/test_svelte_frontend.yml
pull_request:
branches:
- master
Expand Down Expand Up @@ -144,60 +145,6 @@ jobs:
cd ${{ env.SUBDIRECTORY }}
npm install
- name: Start MongoDB
run: |
docker run --rm -d --name mongodb_test -p 27017-27019:27017-27019 mongo:5.0.0
- name: Start Postgres
run: |
docker run --rm -d --name postgres_test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=changeme postgres:9.6.23-alpine3.14
- name: Run integration tests
run: |
poetry run pytest ${{ env.SUBDIRECTORY }}/test_frontend/test_integration.py
deploy_frontend:
env:
SUBDIRECTORY: svelte_frontend
strategy:
matrix:
os: [ubuntu-latest]
node: ['16']
runs-on: ${{ matrix.os }}
needs: [test_frontend, test_e2e, test_integration]

steps:
- uses: actions/checkout@v2

- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Cache npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-${{ env.SUBDIRECTORY }}-node-production-${{ hashFiles('**/package-lock.json') }}

- name: Install npm dependencies
run: |
cd ${{ env.SUBDIRECTORY }}
npm install --production
- name: Build frontend
run: |
cd ${{ env.SUBDIRECTORY }}
npm run build
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v2
with:
committer: Deployer Bot <[email protected]>
author: Deployer Bot <[email protected]>
allow_empty_commit: false
target_branch: gh-pages
build_dir: ${{ env.SUBDIRECTORY }}/build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ venv.bak/
build
.svelte-kit
node_modules
react_frontend/src/index.css
react_frontend/.next
react_frontend/test_frontend/latest_logs
svelte_frontend/test_frontend/latest_logs
svelte_frontend/latest_logs
latest_logs

# Test files from main.py
hello_world.txt
Expand All @@ -130,5 +129,5 @@ db.json
sqlite_asyncio_example.db
todos.db

# Ignore local data folder
/data
# Fastapi files
fastapi_server/data
15 changes: 0 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ repos:
entry: bash -c "cd svelte_frontend && npm run format"
pass_filenames: false

- id: format_react
name: format_react
stages: [commit]
language: system
entry: bash -c "cd react_frontend && npm run format"
pass_filenames: false

- id: pylint
name: pylint
stages: [commit]
Expand Down Expand Up @@ -161,14 +154,6 @@ repos:
entry: poetry run pytest svelte_frontend/test_frontend/test_e2e.py --benchmark-skip --headless
pass_filenames: false

# Run react e2e tests
- id: react_e2e_tests
name: react_e2e_tests
stages: [commit]
language: system
entry: poetry run pytest react_frontend/test_frontend/test_e2e.py --benchmark-skip --headless
pass_filenames: false

# - id: pytest-cov
# name: pytest
# stages: [push]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# Monorepo
My monorepo for various tools and showcases

[Preview](https://burnysc2.github.io/monorepo/)

# Useful Poetry commands
https://python-poetry.org/docs/cli/
### Create new project
Expand Down Expand Up @@ -53,6 +51,8 @@ Single file:
`poetry run pytest test/test_functions.py`
Single function:
`poetry run pytest test/test_functions.py::test_fuction_name`
Single function in class:
`poetry run pytest test/test_functions.py::class_name::test_fuction_name`

Test all files in project:
`poetry run pytest`
Expand All @@ -76,5 +76,5 @@ poetry run pre-commit run --all-files

This runs pylint, mypy, pytest tests, apply autoformatter yapf

# Autoformat all files
# Autoformat all python files
`poetry run yapf ./**/*.py -i`
Loading

0 comments on commit 46ff664

Please sign in to comment.