-
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.
- Loading branch information
Showing
6 changed files
with
105 additions
and
0 deletions.
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,13 @@ | ||
.git | ||
.github | ||
.venv | ||
*.pyc | ||
*.env | ||
.coverage | ||
.devcontainer | ||
.gitignore | ||
.pre-commit-config.yaml | ||
.pytest_cache | ||
.ruff_cache | ||
__pycache__ | ||
tests |
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,27 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "feature/**" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
docker: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # to retrieve git tags | ||
# How to set system path variable in github action workflow: https://stackoverflow.com/a/68214331 | ||
- name: Add to PATH | ||
shell: bash | ||
run: | | ||
echo "/home/runner/bin" >> $GITHUB_PATH | ||
- name: Run CI tests for Docker | ||
shell: bash | ||
run: | | ||
make ci-test-docker TOOLS_DIR="/home/runner/bin" |
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,24 @@ | ||
FROM python:3.11.8-slim-bookworm | ||
|
||
ARG GIT_REVISION="0000000" | ||
ARG GIT_TAG="x.x.x" | ||
|
||
WORKDIR /app | ||
# hadolint ignore=DL3008 | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -y \ | ||
curl \ | ||
make \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install poetry: https://python-poetry.org/docs/#installing-with-the-official-installer | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
# Install dependencies | ||
COPY pyproject.toml poetry.lock Makefile /app/ | ||
RUN poetry config virtualenvs.create false && make install-deps | ||
COPY . . | ||
|
||
CMD ["python", "main.py"] |
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
def add_numbers(a, b): | ||
return a + b | ||
|
||
|
||
if __name__ == "__main__": | ||
print(f"{add_numbers(3, 4)}") |