Skip to content

Commit

Permalink
update github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
grillazz committed Feb 19, 2024
1 parent 1c1ecf1 commit cb92c0a
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
name: Unit Tests
name: CI

on: [pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
fail-fast: false
poetry-version: [ "1.7.1" ]

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

services:
mongodb:
Expand All @@ -27,31 +49,11 @@ jobs:
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
uses: abatilo/actions-poetry@v2
with:
path: .venv
key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }}
poetry-version: ${{ matrix.poetry-version }}
- 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

0 comments on commit cb92c0a

Please sign in to comment.