Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 51 additions & 15 deletions .github/workflows/DailyRun.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,64 @@
name: Daily Main Script
name: Daily Run

on:
schedule:
- cron: '0 5 * * *' # 8 AM IDT (UTC+3)
- cron: '0 5 * * *' # 8AM IDT (UTC+3) = 5AM UTC
workflow_dispatch: # Enables manual run from GitHub UI

jobs:
run-main:
run-program:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v4
with:
python-version: '3.x' # Adjust to your Python version

python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install requests==2.32.4 spotipy==2.25.1

- name: Run main.py
run: python main.py
pip install --no-cache-dir -r requirements.txt
pip install --no-cache-dir beautifulsoup4
- name: Verify environment variables
run: |
echo "Checking environment variables..."
if [ -n "$GENIUS_ACCESS_TOKEN" ]; then
echo "GENIUS_ACCESS_TOKEN is set"
else
echo "GENIUS_ACCESS_TOKEN is not set"
fi
if [ -n "$SPOTIFY_CLIENT_ID" ]; then
echo "SPOTIFY_CLIENT_ID is set"
else
echo "SPOTIFY_CLIENT_ID is not set"
fi
if [ -n "$SPOTIFY_CLIENT_SECRET" ]; then
echo "SPOTIFY_CLIENT_SECRET is set"
else
echo "SPOTIFY_CLIENT_SECRET is not set"
fi
if [ -n "$GOOGLE_API_KEY" ]; then
echo "GOOGLE_API_KEY is set"
else
echo "GOOGLE_API_KEY is not set"
fi
if [ -n "$TELEGRAM_BOT_TOKEN" ]; then
echo "TELEGRAM_BOT_TOKEN is set"
else
echo "TELEGRAM_BOT_TOKEN is not set"
fi
if [ -n "$TELEGRAM_CHANNEL_ID" ]; then
echo "TELEGRAM_CHANNEL_ID is set"
else
echo "TELEGRAM_CHANNEL_ID is not set"
fi
- name: Run program
env:
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
GENIUS_ACCESS_TOKEN: ${{ secrets.GENIUS_ACCESS_TOKEN }}
TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
run: |
python main.py
21 changes: 2 additions & 19 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,7 @@ on:
branches: [ main ]

jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install safety
- name: Check for security vulnerabilities
run: |
safety check

test:
needs: security-scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -35,8 +18,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install requests==2.32.4 spotipy==2.25.1
pip install --no-cache-dir -r requirements.txt
pip install --no-cache-dir beautifulsoup4 pytest-asyncio
- name: Run tests
run: |
python -m pytest -v
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,23 @@ cython_debug/
.cursorindexingignore

.DS_Store

# pytest
.pytest_cache/
.coverage
htmlcov/

# Virtual Environment
venv/
env/
ENV/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ python-dotenv==1.0.1
schedule==1.2.1
spotipy==2.25.1
pytest==8.0.0
pytest-mock==3.12.0
pytest-mock==3.12.0
aiohttp==3.10.11
altgraph==0.17.2
six==1.15.0