Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
packaging and docker
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshKarpel committed Dec 10, 2022
1 parent c8b4b1e commit c8bf12d
Show file tree
Hide file tree
Showing 39 changed files with 74 additions and 39 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: publish-package

on:
release:
types: [published]

jobs:
ghcr:
runs-on: ubuntu-latest
steps:
- name: Set meta info
id: set-meta
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
echo ::set-output name=repo::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1
with:
install: true
- name: Log in to GHCR
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image and Push to GHCR
uses: docker/build-push-action@v3.2.0
with:
file: ./docker/Dockerfile
pull: true
push: true
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
ghcr.io/${{ steps.set-meta.outputs.repo }}:latest
ghcr.io/${{ steps.set-meta.outputs.repo }}:${{ steps.set-meta.outputs.tag }}
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ghcr.io/joshkarpel/spiel:v0.4.2

RUN : \
&& apt-get update \
&& apt-get install -y libasound2-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& :

WORKDIR /app

COPY .. /app/pytest-its-whats-for-testing
RUN pip install --no-cache-dir /app/pytest-its-whats-for-testing

CMD ["spiel", "present", "pytest-its-whats-for-testing/pytest_its_whats_for_testing/slides.py"]
8 changes: 8 additions & 0 deletions docker/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -eux

TAG="pytest-its-whats-for-testing:test"

docker build -f docker/Dockerfile -t "$TAG" .
docker run -it --rm "$TAG" $@
34 changes: 8 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = ""
authors = ["Josh Karpel <josh.karpel@gmail.com>"]
readme = "README.md"
packages = [{include = "pytest_its_whats_for_testing"}]
include = ["images/*", "sounds/*"]

[tool.poetry.dependencies]
python = "^3.10"
Expand All @@ -13,7 +13,7 @@ pytest-mock = "^3.10.0"
pytest-timeout = "^2.1.0"
pytest-xdist = "^3.0.2"
simpleaudio = "^1.0.4"
spiel = "==0.4.1"
spiel = "==0.4.2"
hypothesis = "^6.60.0"

[build-system]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
6 changes: 5 additions & 1 deletion talk/slides.py → pytest_its_whats_for_testing/slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from rich.table import Table
from rich.text import Text
from simpleaudio import WaveObject
from spiel import Slide, Triggers
from spiel import Slide, Triggers, present
from spiel.deck import Deck
from spiel.renderables.image import Image

Expand Down Expand Up @@ -432,3 +432,7 @@ def what_next():
),
vertical="middle",
)


if __name__ == "__main__":
present(__file__)
File renamed without changes.
10 changes: 0 additions & 10 deletions talk/examples/assertions/util.py

This file was deleted.

0 comments on commit c8bf12d

Please sign in to comment.