Skip to content

Initial setup workflow updated #5

Initial setup workflow updated

Initial setup workflow updated #5

name: Test Initial Setup
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
use-cache:
description: 'Use cached dependencies'
required: false
default: 'true'
jobs:
initial_setup:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Check Out Repository
uses: actions/checkout@v2
# Step 2: Set Up Python
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
# Step 3: Conditionally Cache Python dependencies
- name: Cache Python dependencies
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-cache == 'true' }}
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Step 4: Create and activate virtual environment
- name: Create and Activate Virtual Environment
run: |
set -e
python -m venv venv
echo "Virtual environment created."
# Step 5: Install Python Dependencies from requirements.txt
run: |

Check failure on line 50 in .github/workflows/initial_setup_test.yml

View workflow run for this annotation

GitHub Actions / Test Initial Setup

Invalid workflow file

The workflow is not valid. .github/workflows/initial_setup_test.yml (Line: 50, Col: 9): 'run' is already defined .github/workflows/initial_setup_test.yml (Line: 57, Col: 9): 'run' is already defined

Check failure on line 50 in .github/workflows/initial_setup_test.yml

View workflow run for this annotation

GitHub Actions / Test Initial Setup

Invalid workflow file

The workflow is not valid. .github/workflows/initial_setup_test.yml (Line: 50, Col: 9): 'run' is already defined .github/workflows/initial_setup_test.yml (Line: 57, Col: 9): 'run' is already defined
set -e
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# Step 6: Set Up .env file
run: |
set -e
source venv/bin/activate
cp .env.template .env
PROJECT_ROOT=$(pwd)
sed -i "s|/path/to/your/project/root|$PROJECT_ROOT|g" .env
# Step 7: Configure Database and Show Table Info
run: |
set -e
source venv/bin/activate
# Configure database
sed -i 's|path: "data/NBA_AI_2023_2024.sqlite"|path: "data/NBA_AI_BASE.sqlite"|g' config.yaml
# Display database tables and record counts
DB_PATH="data/NBA_AI_BASE.sqlite"
echo "Database tables and record counts:"
sqlite3 $DB_PATH <<EOF
.tables
EOF
# Loop through each table and display the record count
for table in $(sqlite3 $DB_PATH ".tables"); do
count=$(sqlite3 $DB_PATH "SELECT COUNT(*) FROM $table;")
echo "Table: $table, Record Count: $count"
done