Skip to content

Commit

Permalink
Fix GitHub workflow file to install poetry from actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Stawicki committed Oct 28, 2024
1 parent 9365e84 commit 55a823f
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ name: Run Tests on src Changes
on:
push:
paths:
- 'src/**' # Trigger on changes in the src directory
- 'tests/**' # Trigger on changes in the tests directory
- 'src/**' # Trigger on changes in the src directory
- 'tests/**' # Trigger on changes in the tests directory
- '.github/workflows/test.yml' # Trigger on changes to the workflow file
pull_request:
paths:
- 'src/**' # Trigger on changes in the src directory
- 'tests/**' # Trigger on changes in the tests directory
- '.github/workflows/test.yml' # Trigger on changes to the workflow file
- 'src/**'
- 'tests/**'
- '.github/workflows/test.yml'
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
Expand All @@ -23,26 +23,36 @@ jobs:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

steps:
# Checkout the latest code
# ----------------------------------------------
# Checkout Repository
# ----------------------------------------------
- name: Checkout code
uses: actions/checkout@v4

# Set up Python
# ----------------------------------------------
# Set Up Python
# ----------------------------------------------
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.12' # Specify your Python version

# Install Poetry
# ----------------------------------------------
# Install Poetry
# ----------------------------------------------
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "::add-path::$(python3 -m site --user-base)/bin"
uses: snok/install-poetry@v1
with:
version: '1.5.1' # Specify the desired Poetry version

# Install dependencies via Poetry
# ----------------------------------------------
# Install Dependencies
# ----------------------------------------------
- name: Install dependencies
run: poetry install
run: poetry install --no-interaction --no-root

# Run tests using pytest
# ----------------------------------------------
# Run Tests
# ----------------------------------------------
- name: Run Pytest
run: poetry run pytest

0 comments on commit 55a823f

Please sign in to comment.