diff --git a/.github/workflows/DailyRun.yml b/.github/workflows/DailyRun.yml index da026ba..27e45ad 100644 --- a/.github/workflows/DailyRun.yml +++ b/.github/workflows/DailyRun.yml @@ -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 diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index ea71d2c..1cc5f5d 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -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 @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9a56cf3..ef8f0c2 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/requirements.txt b/requirements.txt index d451d56..f000f67 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file +pytest-mock==3.12.0 +aiohttp==3.10.11 +altgraph==0.17.2 +six==1.15.0