Julian-Hans's picture
added manual trigger to tests
9a049de
# ----ATTRIBUTION-START----
# LLM: Github Copilot
# PROMPT: i have written tests. i run them like this pytest test_blip_image_caption_large.py test_phi3_mini_4k_instruct.py test_musicgen_small.py - help me create a github runner that runs these tests - it also needs to create the environment variable "HF_API_TOKEN". it is added to the github repo under the name HF_API_TOKEN
# EDITS: /
name: Run Pytest Tests
# Triggers the workflow on push or pull request to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Manual trigger
jobs:
test:
runs-on: ubuntu-latest
env:
# Create the HF_API_TOKEN environment variable from the repository secrets
HF_API_TOKEN: ${{ secrets.HF_API_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x" # Set your preferred Python version here
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Ensure you have a requirements.txt in your repo
- name: Run Pytest tests
run: |
pytest test_blip_image_caption_large.py test_phi3_mini_4k_instruct.py test_musicgen_small.py
# -----ATTRIBUTION-END-----