Run Tests with GPU #24
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: Run Tests with GPU | |
on: | |
workflow_dispatch: # Allows for manual triggering | |
concurrency: | |
group: run-tests-gpu # Fixed group name to ensure only one instance runs | |
cancel-in-progress: false | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set SSH permissions | |
run: | | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
sudo chown $USER:$USER ~/.ssh | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install and configure dstack | |
run: | | |
pip install dstack | |
dstack config --url https://sky.dstack.ai --project ${{ secrets.DSTACK_PROJECT }} --token ${{ secrets.DSTACK_TOKEN }} | |
dstack init | |
- name: Run tests with GPU | |
run: | | |
HF_TOKEN=${{ secrets.HF_TOKEN }} dstack apply -f tests.dstack.yml --force -y | |
- name: Extract pytest logs | |
if: ${{ always() }} | |
run: | | |
dstack logs aana-tests | sed -n '/============================= test session starts ==============================/,$p' |