46 switch to python 311 #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
fail-fast: false | |
services: | |
mongodb: | |
image: mongo:7.0.3 | |
env: | |
MONGO_INITDB_DATABASE: greenhouse | |
MONGO_INITDB_ROOT_USERNAME: farmer | |
MONGO_INITDB_ROOT_PASSWORD: tractor | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Test Code | |
run: poetry run pytest | |
env: | |
PYTHONDONTWRITEBYTECODE: 1 | |
PYTHONUNBUFFERED: 1 | |
ENVIRONMENT: test | |
TESTING: 0 | |
UP: up | |
DOWN: down | |
WEB_SERVER: web_server | |
MONGO_HOST: mongodb | |
MONGO_PORT: 27017 | |
MONGO_USER: farmer | |
MONGO_PASS: tractor | |
MONGO_DB: greenhouse | |
MONGO_COLLECTION: greens | |
MONGO_TEST_DB: farmland | |
MONGO_URL: mongodb://farmer:[email protected]:27017/?retryWrites=true&w=majority |