Init CI #56
Workflow file for this run
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
# 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" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
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 . -name '*.pyc' -delete | |
find . -name '__pycache__' -type d -exec rm -rf {} + | |
- name: Cache Dependencies | |
uses: actions/cache@v2 | |
id: cache-venv | |
with: | |
path: ./.venv/ | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-venv- | |
- name: Install Dependencies if Cache Missed | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
run: | | |
python -m venv ./.venv | |
source ./.venv/bin/activate | |
cd triton_viz | |
pip install -e . | |
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121 | |
pip uninstall pytorch-triton -y | |
- name: Clone Triton and Install | |
run: | | |
source ./.venv/bin/activate | |
git clone https://github.com/openai/triton.git | |
cd triton/python | |
pip install -e . | |
- name: Lint with pre-commit | |
run: | | |
source ./.venv/bin/activate | |
cd triton_viz | |
pre-commit run --all-files | |
- name: Test with pytest | |
run: | | |
source ./.venv/bin/activate | |
cd triton_viz | |
pytest Examples |