-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
160 changed files
with
9,431 additions
and
7,598 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
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,44 @@ | ||
# Custom variables initialisation | ||
|
||
# Docker volumes | ||
# export UPLOAD_DIR= | ||
# export LOG_DIR= | ||
# export DATABASE_DIR= | ||
# export REDIS_DIR= | ||
|
||
# Application | ||
export FLASK_APP=fittrackee | ||
export FLASK_SKIP_DOTENV=1 | ||
# export APP_PORT=5000 | ||
export APP_SECRET_KEY='PLEASE CHANGE ME' | ||
export APP_LOG=/usr/src/app/logs/fittrackee.log | ||
export UPLOAD_FOLDER=/usr/src/app/uploads | ||
|
||
# PostgreSQL | ||
export POSTGRES_USER=fittrackee | ||
export POSTGRES_PASSWORD= | ||
export POSTGRES_DB=fittrackee | ||
export DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@fittrackee-db:5432/${POSTGRES_DB} | ||
# export DATABASE_DISABLE_POOLING= | ||
|
||
# Redis (required for API rate limits and email sending) | ||
export REDIS_URL=redis://redis:6379 | ||
|
||
# API rate limits | ||
# export API_RATE_LIMITS="300 per 5 minutes" | ||
|
||
# Emails | ||
export UI_URL= | ||
export EMAIL_URL= | ||
export SENDER_EMAIL= | ||
|
||
# Workouts | ||
# export TILE_SERVER_URL= | ||
# export STATICMAP_SUBDOMAINS= | ||
# export MAP_ATTRIBUTION= | ||
# export DEFAULT_STATICMAP=False | ||
|
||
# Weather | ||
# available weather API providers: visualcrossing | ||
# export WEATHER_API_PROVIDER= | ||
# export WEATHER_API_KEY= |
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,85 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
type: string | ||
default: 3.13 | ||
postgres-version: | ||
type: string | ||
default: 17 | ||
previous-version: | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
test_package: | ||
runs-on: ubuntu-latest | ||
container: python:${{ inputs.python-version }} | ||
services: | ||
postgres: | ||
image: postgres:${{ inputs.postgres-version }} | ||
env: | ||
POSTGRES_DB: fittrackee_test | ||
POSTGRES_USER: fittrackee | ||
POSTGRES_PASSWORD: fittrackee | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
selenium: | ||
image: selenium/standalone-firefox | ||
mailhog: | ||
image: mailhog/mailhog:latest | ||
redis: | ||
image: redis:latest | ||
env: | ||
APP_SETTINGS: fittrackee.config.End2EndTestingConfig | ||
DATABASE_TEST_URL: "postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test" | ||
FLASK_APP: fittrackee | ||
EMAIL_URL: "smtp://mailhog:1025" | ||
REDIS_URL: "redis://redis:6379" | ||
HOST: "0.0.0.0" | ||
PORT: 5000 | ||
SENDER_EMAIL: fittrackee@example.com | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install previous version of FitTrackee from PyPI | ||
if: inputs.python-version.previous-version | ||
run: python3 -m pip install fittrackee | ||
|
||
- name: Run migrations | ||
if: inputs.python-version.previous-version | ||
run: ftcli db upgrade | ||
|
||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Create and source virtual environment | ||
run: | | ||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
- name: Install fittrackee package | ||
run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz | ||
|
||
- name: Run migrations | ||
run: ftcli db upgrade | ||
|
||
- name: Install pytest and selenium | ||
run: python3 -m pip install pytest==8.2.0 pytest-selenium==4.1.0 selenium==4.20.0 pytest-html==4.1.1 | ||
|
||
- name: Start application and run tests with Selenium | ||
run: | | ||
setsid nohup fittrackee >> nohup.out 2>&1 & | ||
export TEST_APP_URL=http://$(hostname --ip-address):5000 | ||
sleep 5 | ||
nohup flask worker --processes=1 >> nohup.out 2>&1 & | ||
pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1 |
Oops, something went wrong.