Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update master branch #35

Merged
merged 393 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
393 commits
Select commit Hold shift + click to select a range
a242ca3
Make frontend folder an argument
BurnySc2 Jun 21, 2022
7f84a38
Make each packages self dependent
BurnySc2 Jun 21, 2022
1657d04
Fix poetry install location
BurnySc2 Jun 24, 2022
df1de7b
Add and apply pycln and isort
BurnySc2 Jun 24, 2022
ceda600
Set default version for uvicorn
BurnySc2 Jun 24, 2022
1366c05
Print installed backend packages
BurnySc2 Jun 24, 2022
e5d63e0
Fix cache folders
BurnySc2 Jun 24, 2022
9f2b361
Test CI change
BurnySc2 Jun 24, 2022
ae82dc0
Fix working directory
BurnySc2 Jun 24, 2022
3b1b057
Replace try except with suppress
BurnySc2 Jun 24, 2022
93583e2
Add explicit uvicorn
BurnySc2 Jun 24, 2022
bdcd7f1
Use pip install uvicorn
BurnySc2 Jun 25, 2022
15b22b6
Add logging
BurnySc2 Jun 25, 2022
02628d3
Update burny_common
BurnySc2 Jun 25, 2022
7fb600e
List poetry packages
BurnySc2 Jun 25, 2022
d1e19eb
Update burny_common
BurnySc2 Jun 25, 2022
e66a13d
Update python version in CI
BurnySc2 Jun 25, 2022
6c404e5
Disable backend cache for CI for svelte_frontend
BurnySc2 Jun 30, 2022
1084eff
Add portpicker to fix integration tests
BurnySc2 Jun 30, 2022
0e30e7d
Bump version
BurnySc2 Jun 30, 2022
d71f87f
Update packages of svelte_frontend
BurnySc2 Jun 30, 2022
21481c0
Show envs on error
BurnySc2 Jun 30, 2022
0aa8f12
Add logging on error
BurnySc2 Jun 30, 2022
f77d1cd
Fix integration tests
BurnySc2 Jul 1, 2022
f8f6d01
Disable running a fastapi server test
BurnySc2 Jul 1, 2022
adcfdee
Add other OS to run python code checks
BurnySc2 Jul 5, 2022
f0b48f9
Add login, register, lobbies create and join and start game functiona…
BurnySc2 Jul 9, 2022
c9d93bd
Add test-all
BurnySc2 Jul 10, 2022
0704c64
Update packages, fix integration tests
BurnySc2 Jul 10, 2022
b5e93ee
Separate packages
BurnySc2 Jul 10, 2022
3a4f146
Remove test:all
BurnySc2 Jul 10, 2022
6a37699
Add node 14 again
BurnySc2 Jul 10, 2022
4dfb02d
Add missing version 14
BurnySc2 Jul 10, 2022
f79e0d3
Add missing run tests
BurnySc2 Jul 10, 2022
d6f0355
Add vite
BurnySc2 Jul 10, 2022
f7cd856
Exclude node 14 from specific runs
BurnySc2 Jul 10, 2022
5e9f17b
Add loadstate wait
BurnySc2 Jul 10, 2022
bad43b8
Add loadstate wait
BurnySc2 Jul 10, 2022
de0c212
Add intent to discord bot configuration
BurnySc2 Sep 4, 2022
a8a1f4d
Update package name
BurnySc2 Sep 4, 2022
4241b76
Fix cache path
BurnySc2 Sep 4, 2022
85a89b8
Update cache paths
BurnySc2 Sep 4, 2022
6aec8e2
Fix svelte_frontend tests
BurnySc2 Sep 4, 2022
49d1b8f
Add pydantic example
BurnySc2 Sep 22, 2022
3069f67
Simplify supabase async client
BurnySc2 Sep 22, 2022
46d2865
Add twitch clipper
BurnySc2 Oct 7, 2022
8083ca2
Add ffmpeg to docker image
BurnySc2 Oct 7, 2022
ceaba9b
Add apt update to be able to find ffmpeg
BurnySc2 Oct 7, 2022
9ecb45c
Use crf instead of calculating bitrate manually
BurnySc2 Oct 7, 2022
cb9be8d
Make subprocess calls async
BurnySc2 Oct 7, 2022
be0568a
Remove endpoint to lower quality of clip
BurnySc2 Oct 7, 2022
3d6aecf
Add pyupgrade
BurnySc2 Nov 4, 2022
7241cf9
Fix pylint
BurnySc2 Nov 4, 2022
47cb5d6
Update packages in python_examples
BurnySc2 Nov 4, 2022
c31f18b
Add sqlite links
BurnySc2 Nov 19, 2022
9d6a637
Update pytest and pytest-benchmark version
BurnySc2 Nov 19, 2022
24d4faf
Add pony sql example
BurnySc2 Dec 17, 2022
e347038
Use mongo 5.0 instead of 5.0.0
BurnySc2 Dec 17, 2022
7e8ed4b
Use default mongo version
BurnySc2 Dec 17, 2022
c33cd35
Add running multiple jobs in parallel using xonsh
BurnySc2 Feb 6, 2023
3849b03
Update run multiple in parallel in xonsh
BurnySc2 Feb 6, 2023
fd2dad3
Refactor to working example
BurnySc2 Feb 7, 2023
62f061d
Improve comments
BurnySc2 Feb 7, 2023
f326fd6
Update discord client and libs
BurnySc2 Feb 11, 2023
f26590f
Fix tests
BurnySc2 Feb 11, 2023
bd36d62
Update github actions checkout and setup-python
BurnySc2 Feb 11, 2023
4c62a49
Add python 3.11 to github actions
BurnySc2 Feb 11, 2023
020ce7d
Add twss system
BurnySc2 Feb 12, 2023
d4c2796
Insert message when received
BurnySc2 Feb 12, 2023
c3bcac3
Catch exception when trying to add duplicate
BurnySc2 Feb 12, 2023
37f57c9
Add leaderboard command
BurnySc2 Feb 12, 2023
71f2e91
Fix delete-message only allowed for mentioned users
BurnySc2 Feb 13, 2023
164814d
Set twss target emoji count to 3, write message to channel if >=3 rea…
BurnySc2 Feb 14, 2023
785eb90
Add earthly, replace pylint with ruff, replace mypy with pyre-check (…
BurnySc2 Mar 7, 2023
e45d233
Use python3.10 instead of 3.11 in discord bot
BurnySc2 Mar 8, 2023
ad0676f
Add aoe4 discord command (#18)
BurnySc2 Apr 15, 2023
79b6adf
Add and fix 'ruff' checks
BurnySc2 Apr 15, 2023
ad89bca
Add 'ruff' settings to python projects (#19)
BurnySc2 Apr 15, 2023
1cf13af
Add .earthlyignore
BurnySc2 Apr 15, 2023
deb0fa6
Run earthly on pre-commit hook
BurnySc2 Apr 15, 2023
debea09
Convert dataclass to basemodel, add types for request response json, …
BurnySc2 Apr 20, 2023
4536f8b
Fix tests and circumvent regex check by supabase
BurnySc2 Apr 20, 2023
7847866
Fix earthly_project_check
BurnySc2 Apr 20, 2023
24e9d6e
Add vscode settings and update README
BurnySc2 May 28, 2023
aade273
Add transcribe service idea
BurnySc2 May 30, 2023
3cf3f07
Add basic backend service
BurnySc2 Jun 1, 2023
561418d
Add working downloader
BurnySc2 Jun 2, 2023
a5978ff
Add comments and readme file
BurnySc2 Jun 3, 2023
7aa7349
Add media datetime filter
BurnySc2 Jun 3, 2023
faa06f6
Add mp3 extraction from videos
BurnySc2 Jun 4, 2023
2932c25
Add backend transcriber
BurnySc2 Jun 6, 2023
4741c95
Add small improvements to transcriber_backend
BurnySc2 Jun 7, 2023
3982bab
Merge telegram downloader with transcriber
BurnySc2 Jun 10, 2023
363564d
Add autodeploy and pyre and ruff checks
BurnySc2 Jun 10, 2023
fae700f
Merge pull request #28 from BurnySc2/add-whisper
BurnySc2 Jun 10, 2023
2f28125
Fix small forgotten things
BurnySc2 Jun 10, 2023
b405198
Attempt to run mp3 extraction in background
BurnySc2 Jun 12, 2023
53eb486
Catch crashing create_task workers and fix parallel downloads
BurnySc2 Jun 12, 2023
277d772
Add duplicate finder and fix glob searcher
BurnySc2 Jun 12, 2023
3558014
Refactor and use raw sql query to perform filter faster
BurnySc2 Jun 14, 2023
3102002
Fix missing bracket
BurnySc2 Jun 14, 2023
fca5987
Add manualy queries, remove 2 columns
BurnySc2 Jun 15, 2023
a005be6
Add pythonpath to launch.json
BurnySc2 Jun 15, 2023
781cd42
Remove text_searcher
BurnySc2 Jun 15, 2023
b9c0bde
Add app to PYTHONPATH
BurnySc2 Jun 15, 2023
170bf28
Improve duplicate detection
BurnySc2 Jun 16, 2023
17df186
Add batch collect file_ids
BurnySc2 Jun 16, 2023
5a8bda0
Fix downlading messages not being grabbed
BurnySc2 Jun 17, 2023
4b9498e
Fix retry loading messages
BurnySc2 Jun 18, 2023
2d1a428
Fix enqueue jobs
BurnySc2 Jun 18, 2023
7d20c18
Fix tuple with 1 or less elements for sql query
BurnySc2 Jun 18, 2023
ca52752
Add ffmpeg
BurnySc2 Jun 18, 2023
760e388
Add remove after upload
BurnySc2 Jun 18, 2023
7536e64
Force clear memory when possible
BurnySc2 Jun 19, 2023
d9f8df2
Use bytesIO.getbuffer
BurnySc2 Jun 19, 2023
2d14226
Fix pyre checks
BurnySc2 Jun 19, 2023
32c6567
Refactor write to file when file is too large or not extracting audio
BurnySc2 Jun 19, 2023
9f70dca
Add missing finder_delete_after_upload
BurnySc2 Jun 19, 2023
8d60e59
Fix enum
BurnySc2 Jun 20, 2023
25ed21f
Modify worker to reuse model
BurnySc2 Jun 20, 2023
1555bf7
Add status report
BurnySc2 Jun 20, 2023
f53b5fc
Fix dividing by 0
BurnySc2 Jun 20, 2023
ea762e7
Add scalene
BurnySc2 Jun 26, 2023
734bb6b
Fix unused variable
BurnySc2 Jun 26, 2023
c55fca7
Comment out exit(0)
BurnySc2 Jun 26, 2023
0824091
Refactor generator
BurnySc2 Jun 26, 2023
8e7a321
Push to fix fastapiserver
BurnySc2 Jun 27, 2023
cc2c6b6
Fix python examples
BurnySc2 Jun 27, 2023
6e932ba
Remove node 18 from svelte_frontend
BurnySc2 Jun 27, 2023
244042e
Remove node 18 from frontend checks
BurnySc2 Jun 27, 2023
ba7f1bc
Fix asyncio error
BurnySc2 Jun 27, 2023
3536110
Remove node 18 from svelte frontend integration tests
BurnySc2 Jun 27, 2023
7e4cf60
Update python_examples packages
BurnySc2 Jun 27, 2023
1901b28
Update fastapi_server packages
BurnySc2 Jun 27, 2023
c5aecc9
Update burny_common packages
BurnySc2 Jun 27, 2023
418c56a
Remove node 18 from integration test
BurnySc2 Jun 27, 2023
79172ba
Reduce factor in an attempt to fix tests
BurnySc2 Jun 27, 2023
2a482c8
Fix url
BurnySc2 Jun 27, 2023
1e84fed
Add max_transcribe_mp3_size_bytes
BurnySc2 Jun 28, 2023
3a8b3a8
Delete mp3 file on AV_ERROR
BurnySc2 Jun 28, 2023
b6041f3
Remove ids from argparser to have it only run locally
BurnySc2 Jul 5, 2023
10d0a7e
Remove max_transcribe_mp3_size_bytes again
BurnySc2 Jul 5, 2023
741f6c2
Parse new telegram messages
BurnySc2 Jul 5, 2023
ccdc027
Enable tgcrypto again
BurnySc2 Jul 5, 2023
68898f0
Add pyre-fixme[35]
BurnySc2 Jul 5, 2023
c686b8a
Refactor updating progress
BurnySc2 Jul 7, 2023
67f80b4
Add logging of detecting language
BurnySc2 Jul 9, 2023
71ecef5
Set status to queued after detecting language
BurnySc2 Jul 9, 2023
8c23e05
Set job_started to None after restart or early return
BurnySc2 Jul 9, 2023
7fd0d9b
Calculate processing speed over last 24h instead of 1h
BurnySc2 Jul 9, 2023
34da7c5
Use owncloud to store mp3 files instead of directly in db
BurnySc2 Jul 11, 2023
c46fcdf
Update packages
BurnySc2 Jul 11, 2023
ed2dbcc
Add list_all_joined_public_chats
BurnySc2 Jul 12, 2023
b9f4580
Add wait-for-jobs github action
BurnySc2 Jul 12, 2023
7ff3709
Fix job names
BurnySc2 Jul 12, 2023
5f34128
Fix location of wait-for-jobs
BurnySc2 Jul 12, 2023
aeb44c7
Refactor svelte_frontend
BurnySc2 Jul 12, 2023
efc4a88
Add wait-for-jobs to burny_common, discord_bot, fastapi_server
BurnySc2 Jul 12, 2023
8fcaa3c
Clean up svelte_frontend, use Number() and String() to convert types
BurnySc2 Jul 12, 2023
5c8ed2c
Remove needs in github actions
BurnySc2 Jul 12, 2023
b76f78c
Add channel.last_parsed
BurnySc2 Jul 13, 2023
c38c38d
Log newly added messages
BurnySc2 Jul 21, 2023
db1c217
Fix for unavailable channels
BurnySc2 Jul 22, 2023
acb9d63
Download to file if size > 100mb
BurnySc2 Jul 22, 2023
81a78c5
Replace tailwind with css
BurnySc2 Jul 22, 2023
517b3d3
Add ffmpeg to svelte frontend
BurnySc2 Jul 30, 2023
2e1d930
Add burn subtitles into video
BurnySc2 Jul 30, 2023
4eaeb7b
Only run n amount of ffmpeg processes at a time
BurnySc2 Aug 11, 2023
3ee565c
Add parallel_ffmpeg_count
BurnySc2 Aug 11, 2023
b7f5cd5
Catch errors
BurnySc2 Aug 21, 2023
2466f0f
Clean up and add TODOs
BurnySc2 Aug 21, 2023
d45d099
Add nim examples
BurnySc2 Aug 21, 2023
4dede66
Add transcriber backend to earthly
BurnySc2 Aug 21, 2023
5d8cb1c
Except inaccessible error
BurnySc2 Aug 21, 2023
8c90ccd
Add nim statistics examples
BurnySc2 Aug 27, 2023
e443dad
Add problem sites solutions
BurnySc2 Aug 27, 2023
6aafbfb
Add leetcode nim 169 solution
BurnySc2 Aug 27, 2023
84f1c6e
Add p169 solution for nim and python
BurnySc2 Sep 3, 2023
5943e3a
Add p338 leetcode solution
BurnySc2 Sep 3, 2023
9c269e8
Increase discord reminder limit
BurnySc2 Sep 8, 2023
40e1529
Add p109 solution
BurnySc2 Sep 8, 2023
99ba6a2
Add first working version of nim and htmx
BurnySc2 Sep 8, 2023
c901772
Add p108 attempt
BurnySc2 Sep 9, 2023
a50e44d
Add working todo app
BurnySc2 Sep 9, 2023
2ae28cf
Simplify
BurnySc2 Sep 9, 2023
7b07569
Fix wrong html file name
BurnySc2 Sep 10, 2023
300bb40
Add p202
BurnySc2 Sep 13, 2023
72f7f4a
Add htmx + fastapi example and test
BurnySc2 Sep 13, 2023
3bb78fa
Remove python 3.8 for fastapi
BurnySc2 Sep 13, 2023
30b3878
Remove 3.8 from earthfile
BurnySc2 Sep 13, 2023
883e410
Add https
BurnySc2 Sep 13, 2023
ff389f3
Add login and chat
BurnySc2 Sep 15, 2023
e6a8549
Add import annotations
BurnySc2 Sep 15, 2023
0a0334b
Add another missing import annotations and drop python 3.9
BurnySc2 Sep 15, 2023
9f7f335
Fix typo
BurnySc2 Sep 15, 2023
50504d7
Use case insensitive comparison
BurnySc2 Sep 15, 2023
f1680ff
Update landing page
BurnySc2 Sep 15, 2023
da505b5
Use 'sed -i'
BurnySc2 Sep 15, 2023
8c03536
Turn on ssl only if ip is localhost
BurnySc2 Sep 15, 2023
5125a82
Add frontend url
BurnySc2 Sep 15, 2023
46b8354
Fix template
BurnySc2 Sep 15, 2023
ad567ab
Attempt to fix login
BurnySc2 Sep 15, 2023
80a26f6
Update redirect url
BurnySc2 Sep 15, 2023
b49643a
Attempt to fix login logout
BurnySc2 Sep 16, 2023
e99c345
Set allow_credentials to true
BurnySc2 Sep 16, 2023
e247fb4
Store code as cookie in frontend and send credentials
BurnySc2 Sep 16, 2023
1cc3c32
Fix hx-request
BurnySc2 Sep 16, 2023
dd42b2e
Force deploy
BurnySc2 Sep 16, 2023
ed46de4
Force deploy
BurnySc2 Sep 16, 2023
fd77950
Add withCredentials=true
BurnySc2 Sep 16, 2023
08d49a5
Add brackets
BurnySc2 Sep 16, 2023
4d07441
Use server side rendering
BurnySc2 Sep 16, 2023
ca97ca1
Refactor error messages, simplify
BurnySc2 Sep 16, 2023
7ba9ea4
Add user is typing
BurnySc2 Sep 17, 2023
c411036
Fix https://github.com/BurnySc2/monorepo/issues/32
BurnySc2 Sep 21, 2023
860659f
Use parameters for sql queries
BurnySc2 Sep 21, 2023
532b90c
Change username
BurnySc2 Sep 28, 2023
6b575f9
Refactor htmx
BurnySc2 Oct 28, 2023
a7d5a3a
Add a 15 seconds wait before running get_messages()
BurnySc2 Oct 28, 2023
36a71a8
Use semaphore on get_messages()
BurnySc2 Oct 28, 2023
826d40c
Use while loop instead of wait
BurnySc2 Oct 28, 2023
118f8bd
Add aliases
BurnySc2 Nov 5, 2023
2b7b0d5
Make dockerfile more specific
BurnySc2 Nov 5, 2023
09cf8bb
Change domain name
BurnySc2 Nov 5, 2023
cd3d1e7
Fix extension recommendation
BurnySc2 Nov 22, 2023
cfb30c6
Add ansible factorio setup scripts
BurnySc2 Nov 22, 2023
4bbdade
Add other ansible services
BurnySc2 Nov 24, 2023
13bc745
Add authelia to missing services
BurnySc2 Nov 25, 2023
b132994
Fix syncthing
BurnySc2 Nov 25, 2023
46f5660
Fix pgadmin volume permisson
BurnySc2 Nov 25, 2023
ee4b1e2
Merge pull request #34 from BurnySc2/add-ansible-services
BurnySc2 Nov 25, 2023
0b3d165
Add bookstack and uptime-kuma, remove tubearchivist
BurnySc2 Nov 26, 2023
b5aa241
Add rdiff backup script
BurnySc2 Nov 27, 2023
016dc66
Change permission to chmod700
BurnySc2 Nov 27, 2023
2743639
Fix backup script
BurnySc2 Nov 29, 2023
12fff66
Add ansible set up manjaro pc script
BurnySc2 Nov 29, 2023
29f40bc
Fix postgres backup script
BurnySc2 Nov 29, 2023
48d6ae8
Update gitignores and add pipdeptree
BurnySc2 Nov 29, 2023
547a94e
Update fastapi server dependencies
BurnySc2 Nov 29, 2023
4be389e
Fix ansible naming
BurnySc2 Nov 30, 2023
cfd130d
Improve ansible setup commands order
BurnySc2 Nov 30, 2023
469bef2
Add reactive_resume
BurnySc2 Nov 30, 2023
3b94dce
Add reactive_resume update script
BurnySc2 Nov 30, 2023
910d44d
Update owncloud and remove redis
BurnySc2 Nov 30, 2023
ab60cdd
Add sonarcube to github actions
BurnySc2 Dec 2, 2023
edf6f9c
Add bencher to github actions
BurnySc2 Dec 2, 2023
c39f80e
Fix bencher project name
BurnySc2 Dec 2, 2023
caeabd5
Remove bencher again
BurnySc2 Dec 2, 2023
4071466
Update faster-whisper version
BurnySc2 Dec 2, 2023
6279289
Fix test
BurnySc2 Dec 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 61 additions & 0 deletions .github/workflows/earthly_project_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: run_earthly_checks


on: [push, pull_request]

jobs:
run_earthly_checks:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

# In conflict with pyre-check
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Cache burny_common .venv
# uses: actions/cache@v3
# with:
# path: burny_common/.venv
# key: burny_common-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
#
# - name: Cache discord_bot .venv
# uses: actions/cache@v3
# with:
# path: discord_bot/.venv
# key: discord_bot-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
#
# - name: Cache fastapi_server .venv
# uses: actions/cache@v3
# with:
# path: fastapi_server/.venv
# key: fastapi_server-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
#
# - name: Cache python_examples .venv
# uses: actions/cache@v3
# with:
# path: python_examples/.venv
# key: python_examples-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}

# https://earthly.dev/get-earthly
- name: Install Earthly
run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'

- name: Install
run: |
touch discord_bot/SECRETS.toml
earthly +install-all --verbose true --PYTHONVERSION=${{ matrix.python-version }}

- name: Run code checks and tests
run: earthly +all --verbose true --PYTHONVERSION=${{ matrix.python-version }}

# - name: Save cache
# run: earthly +export-cache-backend --verbose true --PYTHONVERSION=${{ matrix.python-version }}
110 changes: 110 additions & 0 deletions .github/workflows/publish_burny_common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: publish_burny_common


on:
push:
paths:
- burny_common/**
- .github/workflows/publish_burny_common.yml
pull_request:
branches:
- master
- develop

env:
SUBDIRECTORY: burny_common

jobs:
run_code_check:
name: run_code_check_py${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

# In conflict with pyre-check
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Cache .venv
# uses: actions/cache@v3
# with:
# path: .venv
# key: ${{ env.SUBDIRECTORY }}-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}

# https://earthly.dev/get-earthly
- name: Install Earthly
run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'

- name: Install
working-directory: ${{ env.SUBDIRECTORY }}
run: earthly +install-dev --verbose true --PYTHONVERSION=${{ matrix.python-version }}

- name: Run code checks and tests
working-directory: ${{ env.SUBDIRECTORY }}
run: earthly +all --verbose true --PYTHONVERSION=${{ matrix.python-version }}

# - name: Save cache
# working-directory: ${{ env.SUBDIRECTORY }}
# run: earthly +export-cache --verbose true --PYTHONVERSION=${{ matrix.python-version }}

build_and_publish:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry

- name: Make poetry use local .venv folder
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v3
with:
path: ${{ env.SUBDIRECTORY }}/.venv
key: ${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ env.SUBDIRECTORY }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
working-directory: ${{ env.SUBDIRECTORY }}
run: poetry install --no-dev

- name: Build
working-directory: ${{ env.SUBDIRECTORY }}
run: poetry build

- id: wait-for-jobs
uses: yogeshlonkar/wait-for-jobs@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
run_code_check_py3.8
run_code_check_py3.9
run_code_check_py3.10
run_code_check_py3.11

# Publish package on pypi
- name: Publish
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
working-directory: ${{ env.SUBDIRECTORY }}
continue-on-error: true
run: poetry publish --username ${{ secrets.pypi_username }} --password ${{ secrets.pypi_password }}
54 changes: 0 additions & 54 deletions .github/workflows/publish_example_package.yml

This file was deleted.

131 changes: 97 additions & 34 deletions .github/workflows/python_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,132 @@ on:
paths:
- python_examples/**
- poetry.lock
- .github/workflows/python_examples.yml
pull_request:
branches:
- master
- develop

env:
SUBDIRECTORY: python_examples

jobs:
run_code_check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

# In conflict with pyre-check
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Cache .venv
# uses: actions/cache@v3
# with:
# path: .venv
# key: ${{ env.SUBDIRECTORY }}-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}

- name: Start MongoDB
uses: ankane/setup-mongodb@v1

- name: Start Postgres
uses: ankane/setup-postgres@v1
with:
postgres-version: 14

# https://earthly.dev/get-earthly
- name: Install Earthly
run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'

- name: Install
working-directory: ${{ env.SUBDIRECTORY }}
run: earthly +install-dev --verbose true --PYTHONVERSION=${{ matrix.python-version }}

- name: Run code checks and tests
working-directory: ${{ env.SUBDIRECTORY }}
run: earthly +all --verbose true --PYTHONVERSION=${{ matrix.python-version }}

# - name: Save cache
# working-directory: ${{ env.SUBDIRECTORY }}
# run: earthly +export-cache --verbose true --PYTHONVERSION=${{ matrix.python-version }}

run_python_examples:
env:
SUBDIRECTORY: python_examples
needs: [run_code_check]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
mongodb-version: [5.0.0]
python-version: ['3.9', '3.10', '3.11']
include:
- os: macos-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.10'

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache poetry
uses: actions/cache@v2
- name: Install Poetry
run: pip install poetry

- name: Make poetry use local .venv folder
run: poetry config virtualenvs.in-project true

- name: Set up cache
if: matrix.os != 'windows-latest'
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
path: ${{ env.SUBDIRECTORY }}.venv
key: ${{ matrix.os }}-$(python --version)-poetry-${{ env.SUBDIRECTORY }}-${{ hashFiles('poetry.lock') }}

- name: Start MongoDB in docker
run: |
docker run --rm -d -p 27017-27019:27017-27019 --name mongodb mongo:${{ matrix.mongodb-version }}
- name: Start MongoDB
uses: ankane/setup-mongodb@v1
# with:
# mongodb-version: 5.0

- name: Start Postgres in docker
run: |
docker run --rm -d --name postgresql-container -p 5432:5432 \
-e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=changeme postgres:9.6.23-alpine3.14
# - name: Start MongoDB in docker
# if: ${{ matrix.os != 'macos-latest'}}
# run: |
# docker run --rm -d -p 27017-27019:27017-27019 --name mongodb mongo:5.0

- uses: actions/cache@v2
- name: Start Postgres
uses: ankane/setup-postgres@v1
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
postgres-version: 14

# - name: Start Postgres in docker
# if: ${{ matrix.os == 'ubuntu-latest'}}
# run: |
# docker run --rm -d --name postgresql-container -p 5432:5432 \
# -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=changeme postgres:9.6.23-alpine3.14

- name: Print environment variables (linux)
run: |
printenv

- name: Install dependencies
run: |
python -m pip install poetry
poetry install
- name: Install Python dependencies
working-directory: ${{ env.SUBDIRECTORY }}
run: poetry install

- name: Test with pytest
run: |
poetry run pytest ${{ env.SUBDIRECTORY }}
- name: Run Python tests
working-directory: ${{ env.SUBDIRECTORY }}
run: poetry run python -m pytest

- name: Run main.py
run: |
poetry run python ${{ env.SUBDIRECTORY }}/main.py

- name: Run radon (cyclomatic complexity report)
# './' denotes the current directory
run: |
poetry run radon cc ./ -a -nb
working-directory: ${{ env.SUBDIRECTORY }}
run: poetry run python main.py
Loading
Loading