Fix: README Demo video #13
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: Run Pytest Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Set environment variables from secrets | |
run: | | |
echo "YOUTUBE_DATA_API_KEY=${{ secrets.YOUTUBE_DATA_API_KEY }}" >> $GITHUB_ENV | |
echo "SERPER_API_KEY=${{ secrets.SERPER_API_KEY }}" >> $GITHUB_ENV | |
echo "GROQ_API_KEY=${{ secrets.GROQ_API_KEY }}" >> $GITHUB_ENV | |
- name: Fail if any secrets are missing | |
run: | | |
if [ -z "${{ secrets.YOUTUBE_DATA_API_KEY }}" ] || [ -z "${{ secrets.SERPER_API_KEY }}" ] || [ -z "${{ secrets.GROQ_API_KEY }}" ]; then | |
echo "One or more required secrets are missing." | |
exit 1 | |
fi | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ask_web_youtube/requirements.txt | |
pip install pytest | |
- name: Run tests | |
working-directory: ask_web_youtube | |
run: make tests |