fix: update CI workflow to only run writing-app tests #44
Workflow file for this run
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
name: Writing App Tests | |
on: | |
push: | |
paths: | |
- 'writing-app/**' | |
- '.github/workflows/writing-app-tests.yml' | |
pull_request: | |
paths: | |
- 'writing-app/**' | |
- '.github/workflows/writing-app-tests.yml' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./writing-app | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Install dependencies with `pip` | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pytest # Ensure pytest is installed | |
pip list # Debugging step to check installed packages | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgl1 ffmpeg libsm6 libxext6 | |
- name: Start Streamlit App (Run in Background) | |
env: | |
STREAMLIT_BROWSER_GATHER_USAGE_STATS: false | |
STREAMLIT_SERVER_ADDRESS: localhost | |
STREAMLIT_SERVER_PORT: 8501 | |
STREAMLIT_SERVER_HEADLESS: true | |
PYTHONPATH: ${{ github.workspace }}/writing-app | |
run: | | |
streamlit run app.py & | |
sleep 3 # Allow time for Streamlit to initialize | |
- name: Create models directory | |
run: mkdir -p models | |
- name: Run tests with Debug Logging | |
run: | | |
cd ${{ github.workspace }}/writing-app | |
PYTHONPATH=${{ github.workspace }}/writing-app pytest tests/test_app.py -v --log-cli-level=INFO --rootdir=${{ github.workspace }}/writing-app | |
- name: Run Streamlit App Action (Recommended) | |
uses: streamlit/[email protected] | |
with: | |
app-path: 'writing-app/app.py' | |
ruff: true |