-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker compose with test script for local testing.
- Loading branch information
1 parent
9cb1e40
commit a300985
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM python:3.9-slim-bullseye AS test | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL description="Xul Dockerfile" | ||
LABEL version="1.0" | ||
|
||
# Packages. | ||
RUN apt-get update \ | ||
&& apt-get dist-upgrade -y \ | ||
&& apt-get install --no-install-recommends -y \ | ||
&& apt-get autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf/*-old | ||
|
||
ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 | ||
|
||
# Recent pip, setuptools and wheel. | ||
RUN pip install --upgrade pip setuptools wheel | ||
|
||
# Create workdir | ||
WORKDIR /app | ||
|
||
# Install package. | ||
COPY pyproject.toml ./ | ||
COPY src src | ||
COPY docs docs | ||
RUN pip install .[test] | ||
|
||
# Copy test script. | ||
COPY test.sh ./ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
services: | ||
|
||
test: | ||
container_name: xul-test | ||
build: | ||
target: test | ||
|
||
command: ./test.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -u # crash on missing env | ||
set -e # stop on any error | ||
|
||
echo() { | ||
builtin echo -e "$@" | ||
} | ||
|
||
|
||
echo "Lint checks (Ruff)" | ||
ruff check --diff | ||
|
||
echo "\nCheck import sort (isort)" | ||
isort --check --diff . | ||
|
||
echo "\nCheck formatting (Black)" | ||
black --check --diff . | ||
|
||
echo "\nCheck typing (mypy)" | ||
mypy . | ||
|
||
echo "\nChecks complete" |