Skip to content

Commit

Permalink
Install poetry before python and use working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
oshoma committed May 2, 2024
1 parent b1fc9a0 commit d77d062
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/offline_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "poetry"

# Install poetry with virtualenvs disabled for tests
- name: Install poetry and dependencies
- name: Install dependencies
working-directory: ./src
run: |
python -m pip install --upgrade pip
python -m pip install poetry
cd src
poetry install
# en_core_web_sm required by spacy needs to be installed separately
- name: Install extra dependencies
run: |
cd src
poetry run python -m spacy download en_core_web_sm
- name: Run tests
run: |
cd src
working-directory: ./src
run:
poetry run pytest --cov=sherpa_ai tests
21 changes: 8 additions & 13 deletions .github/workflows/online_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "poetry"
# Install poetry with virtualenvs disabled for tests
- name: Install poetry and dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
cd src
poetry config virtualenvs.create false
poetry install

# en_core_web_sm required by spacy needs to be installed separately
- name: Install extra dependencies
- name: Install dependencies
working-directory: ./src
run: |
cd src
poetry install
poetry run python -m spacy download en_core_web_sm
- name: Run tests
Expand All @@ -43,6 +38,6 @@ jobs:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUBOATHKEY }}
DAILY_TOKEN_LIMIT: ${{ secrets.TOKENLIMIT }}
TEMPRATURE: ${{ secrets.TEMPRATURE }}
run: |
cd src
working-directory: ./src
run:
poetry run pytest --external_api --cov=sherpa_ai tests

0 comments on commit d77d062

Please sign in to comment.