-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from max-pfeiffer/feature/multi_arch_image
Feature/multi arch image
- Loading branch information
Showing
22 changed files
with
911 additions
and
612 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 |
---|---|---|
|
@@ -33,14 +33,14 @@ jobs: | |
pylint build tests | ||
black --check . | ||
run-tests: | ||
run-build-image-tests: | ||
needs: code-quality | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -63,24 +63,63 @@ jobs: | |
- name: Run all tests with pytest | ||
run: | | ||
source .venv/bin/activate | ||
pytest --cov | ||
pytest tests/build_image --cov | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
run-publish-image-tests: | ||
needs: code-quality | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.1 | ||
virtualenvs-in-project: true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install --no-interaction --no-root | ||
- name: Run all tests with pytest | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/publish_image --cov | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
publish-all-images: | ||
needs: run-tests | ||
needs: | ||
- run-build-image-tests | ||
- run-publish-image-tests | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v2 | ||
- name: Get Git Commit Tag Name | ||
uses: olegtarasov/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
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 was deleted.
Oops, something went wrong.
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,39 @@ | ||
variable "REGISTRY" { | ||
default = "docker.io" | ||
} | ||
|
||
variable "IMAGE_VERSION" { | ||
default = null | ||
} | ||
|
||
variable "CONTEXT" { | ||
default = "." | ||
} | ||
|
||
target "python-poetry" { | ||
name = "poetry${replace(poetry_version, ".", "-")}-python${replace(python_version, ".", "-")}-${os_variant}" | ||
context = CONTEXT | ||
|
||
matrix = { | ||
python_version = ["3.9.17", "3.10.12", "3.11.4"] | ||
os_variant = ["bullseye", "slim-bullseye"] | ||
poetry_version = ["1.3.2", "1.4.2", "1.5.1"] | ||
} | ||
|
||
args = { | ||
POETRY_VERSION = poetry_version | ||
OFFICIAL_PYTHON_IMAGE = "python:${python_version}-${os_variant}" | ||
} | ||
|
||
platforms = ["linux/amd64", "linux/arm64/v8"] | ||
|
||
tags = ["${REGISTRY}/pfeiffermax/python-poetry:${IMAGE_VERSION}-poetry${poetry_version}-python${python_version}-${os_variant}"] | ||
|
||
cache-to = [ | ||
"type=gha,mode=max" | ||
] | ||
|
||
cache-from = [ | ||
"type=gha" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.