fix: replace deprecated Streamlit params across all dashboard pages #797
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: [working, master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| test-backend: | |
| name: Backend Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install -e ".[dev]" | |
| working-directory: projects/stock-risk-scanner | |
| - run: pytest -v --tb=short | |
| working-directory: projects/stock-risk-scanner | |
| test-dashboard: | |
| name: Dashboard Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install -r requirements.txt | |
| working-directory: dashboard | |
| - run: | | |
| pip install pytest pytest-json-report | |
| echo 'API_URL = "http://localhost:8000"' > .streamlit/secrets.toml | |
| python -m pytest tests/ -v --tb=short --json-report --json-report-file=test_results.json | |
| working-directory: dashboard | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: dashboard/test_results.json | |
| - name: Update test_results.json via PR | |
| if: github.ref == 'refs/heads/master' && success() | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -B ci/test-results | |
| git add dashboard/test_results.json | |
| git diff --cached --quiet && echo "No changes" && exit 0 | |
| git commit -m "ci: update test_results.json" | |
| git push -f origin ci/test-results | |
| # Create or update PR | |
| existing=$(gh pr list --head ci/test-results --state open --json number -q '.[0].number') | |
| if [ -z "$existing" ]; then | |
| gh pr create --title "ci: update test_results.json" \ | |
| --body "Auto-generated by CI. Updates test results for the Tests tab on Streamlit." \ | |
| --head ci/test-results --base master | |
| fi |