From d5cdbec5d3b169651dfe6f5cc9718c67204b612d Mon Sep 17 00:00:00 2001 From: Tejas Ramesh <63494847+tejas3070@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:52:27 -0500 Subject: [PATCH] Update python-app.yml --- .github/workflows/python-app.yml | 43 ++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 9e3c156..31d3f10 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,7 +5,7 @@ name: Python application on: push: - branches: [ "main" ] + branches: [ "main", "tejas3070-patch-1" ] pull_request: branches: [ "main" ] @@ -19,16 +19,49 @@ jobs: 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: Install dependencies + + - name: Cache Python virtual environment and pip cache + uses: actions/cache@v2 + with: + path: | + ~/venv + ~/.cache/pip + key: ${{ runner.os }}-venv-${{ hashFiles('triton_viz/**/requirements.txt', 'triton_viz/**.py', 'triton_viz/**/setup.py') }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-venv-${{ hashFiles('triton_viz/**/requirements.txt', 'triton_viz/**.py', 'triton_viz/**/setup.py') }}- + ${{ runner.os }}-venv- + + - name: Create and activate virtual environment + run: | + python -m venv ~/venv + source ~/venv/bin/activate + + - name: Upgrade pip run: | - python -m pip install --upgrade pip + pip install --upgrade pip + + - name: Clone and install dependency project (e.g., triton) + run: | + git clone https://github.com/openai/triton.git ~/triton + cd ~/triton/python + pip install . + + - name: Install triton_viz + run: | + cd $GITHUB_WORKSPACE/triton_viz pip install . - pip install pytest - pip install pre-commit + + - name: Install main project (triton_viz) dependencies + run: | + pip install -r requirements.txt + - name: Lint with pre-commit run: | pre-commit run --all-files