Skip to content

Commit

Permalink
New workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas committed Dec 4, 2024
1 parent 3247cd8 commit cb84bd6
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 44 deletions.
53 changes: 9 additions & 44 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,31 @@ on:
branches: ["main", "development"]
pull_request:
branches: ["main", "development"]
workflow_dispatch: # Allow manual triggering
workflow_dispatch:

jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Don't cancel other jobs if one fails
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper versioning

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # Cache pip dependencies

- name: Install poetry
shell: bash
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Configure poetry
shell: bash
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry dependencies
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
fetch-depth: 0

- name: Install Open Interpreter
shell: bash
run: |
poetry install --no-interaction --all-extras
curl https://raw.githubusercontent.com/OpenInterpreter/open-interpreter/refs/heads/development/installers/new-installer.sh | sh
- name: Run tests
shell: bash
run: |
poetry run pytest tests/ -v --color=yes
interpreter run tests/ -v --color=yes
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PYTHONUNBUFFERED: "1" # For real-time test output

- name: Upload test results
if: always() # Run even if tests fail
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: |
.pytest_cache
pytest-report.xml
if-no-files-found: ignore
PYTHONUNBUFFERED: "1"
70 changes: 70 additions & 0 deletions archive/classic_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Test

on:
push:
branches: ["main", "development"]
pull_request:
branches: ["main", "development"]
workflow_dispatch: # Allow manual triggering

jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper versioning

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # Cache pip dependencies

- name: Install poetry
shell: bash
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Configure poetry
shell: bash
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry dependencies
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
shell: bash
run: |
poetry install --no-interaction --all-extras
- name: Run tests
shell: bash
run: |
poetry run pytest tests/ -v --color=yes
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PYTHONUNBUFFERED: "1" # For real-time test output

- name: Upload test results
if: always() # Run even if tests fail
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: |
.pytest_cache
pytest-report.xml
if-no-files-found: ignore

0 comments on commit cb84bd6

Please sign in to comment.