Skip to content

Commit

Permalink
Merge pull request #84 from ericmjl/knowledge-graph-example
Browse files Browse the repository at this point in the history
pixi migration and git commit structuredbot change
  • Loading branch information
ericmjl authored Jul 29, 2024
2 parents ac5830a + e63830d commit f7138e4
Show file tree
Hide file tree
Showing 9 changed files with 12,068 additions and 1,236 deletions.
94 changes: 40 additions & 54 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,91 +12,77 @@ env:
jobs:
run-tests:
runs-on: ubuntu-latest
name: Run test suite (Python ${{ matrix.python-version }}, ${{ matrix.environment-type }})
name: Run test suite (Python ${{ matrix.python-version }})

strategy:
matrix:
python-version: [3.11]
environment-type: ['miniconda', 'bare', 'pixi']
python-version: [3.11, 3.12]

# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download Ollama
run: curl -fsSL https://ollama.com/install.sh | sh

- name: Pull Microsoft's Phi3 model
run: ollama pull phi3

- name: Setup Python environment
if: matrix.environment-type == 'bare'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Micromamba Environment
uses: mamba-org/setup-micromamba@v1
if: matrix.environment-type == 'miniconda'
with:
micromamba-version: '1.5.1-2'
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}-${{ hashFiles('environment.yml') }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}-${{ hashFiles('environment.yml') }}
post-cleanup: 'all'

- name: Setup Pixi Environment
if: matrix.environment-type == 'pixi' && github.repository_owner == 'ericmjl'
uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}

- name: Install dependencies
if: matrix.environment-type == 'bare'
# 17 June 2023: Figure out a way to move testing deps to the `pip install -e .` step below.
run: |
python -m pip install -e ".[all]"
- name: Run tests (miniconda/bare)
if: matrix.environment-type == 'miniconda' || matrix.environment-type == 'bare'
run: |
if [ "${{ matrix.environment-type }}" == "miniconda" ]; then
conda activate llamabot
fi
pip install -e ".[all]"
pytest

- name: Run tests (pixi)
if: matrix.environment-type == 'pixi' && github.repository_owner == 'ericmjl'
run: |
pixi run test
- name: Test CLI (miniconda/bare)
if: matrix.environment-type == 'bare' || matrix.environment-type == 'miniconda'
run: |
pip install -e ".[all]"
llamabot --help
- name: Test CLI (pixi)
if: matrix.environment-type == 'pixi' && github.repository_owner == 'ericmjl'
run: |
pixi run llamabot
# https://github.com/codecov/codecov-action
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

smoke-tests:
runs-on: ubuntu-latest
name: Run smoke tests (Python ${{ matrix.python-version }})

strategy:
matrix:
python-version: [3.11, 3.12]
environment-type: ['pixi', 'bare']
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Pixi Environment
uses: prefix-dev/[email protected]
if: ${{ matrix.environment-type == 'pixi' }}
with:
pixi-version: v0.25.0
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: Setup Python
uses: actions/setup-python@v4
if: ${{ matrix.environment-type == 'bare' }}
with:
python-version: ${{ matrix.python-version }}

- name: Test CLI (pixi)
if: matrix.environment-type == 'pixi' && github.repository_owner == 'ericmjl'
run: |
pixi run llamabot-cli
- name: Test CLI (bare)
if: matrix.environment-type == 'bare' && github.repository_owner == 'ericmjl'
run: |
pip install .
llamabot --help
67 changes: 0 additions & 67 deletions environment.yml

This file was deleted.

Loading

0 comments on commit f7138e4

Please sign in to comment.