Skip to content

Update python-app.yml (Test Cache#11) #41

Update python-app.yml (Test Cache#11)

Update python-app.yml (Test Cache#11) #41

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main", "tejas3070-patch-1" ]
# pull_request:
# branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: 'tejas3070-patch-1'
path: 'triton_viz'
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Clean up before caching
run: |
find ~/work/triton-viz/triton-viz -name '*.pyc' -delete
find ~/work/triton-viz/triton-viz -name '__pycache__' -type d -exec rm -rf {} +
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('triton_viz/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Check Triton Installation
id: check_triton
run: |
if python -c "import triton"; then
echo "Triton already installed, skipping installation step."
echo "SKIP_INSTALL=true" >> $GITHUB_ENV
fi
- name: Clone Triton and Install
if: env.SKIP_INSTALL != 'true'
run: |
git clone https://github.com/openai/triton.git triton-main_ci
cd triton-main_ci/python
pip install -e .
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
pip uninstall pytorch-triton -y
- name: Install Dependencies if Cache Missed
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
cd triton_viz
pip install -e .
pip install -r requirements.txt
- name: Lint with pre-commit
run: |
cd triton_viz
pre-commit run --all-files
- name: Test with pytest
run: |
cd triton_viz
cd Examples
rm -rf sum.py
cd ..
pytest Examples