Skip to content

Commit

Permalink
Set up CI with poetry and tests (#17)
Browse files Browse the repository at this point in the history
* Set up CI with poetry and tests

* Run from the venv

* Making pytest happy.

* Turns out you have to commit all the changes.

* See if we can get this to work with HELM's enormous cache.

* Another try at fixing caching.
  • Loading branch information
wpietri authored Dec 7, 2023
1 parent c4da412 commit 64d7390
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Python application

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

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: cache poetry install
uses: actions/cache@v3
id: cache-poetry
with:
path: ~/.local
key: poetry-1.7.1-0

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: cache deps
id: cache-deps
uses: actions/cache@v3
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}


- name: Install dependencies
run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'

- name: Test with pytest
run: |
source .venv/bin/activate
pytest
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pytest = "^7.4.3"
addopts = [
"--import-mode=importlib",
]

pythonpath = [
"src"
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file added src/coffee/__init__.py
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_helm_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest

from run import CliHelmRunner, BbqHelmTest, HelmSut, HelmResult, RidiculousBenchmark, quantize_stars
from coffee.run import CliHelmRunner, BbqHelmTest, HelmSut, HelmResult, RidiculousBenchmark, quantize_stars


def test_cli_helm_runner_command():
Expand Down

0 comments on commit 64d7390

Please sign in to comment.