Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ jobs:
# AWS compatibility tests drive the real AWS CLI (preinstalled on the runner) and boto3.
- run: pip install boto3 cryptography pycognito && aws --version
- run: go vet ./...
- run: go test -race -timeout 30m ./...
- run: go test -race -timeout 30m -coverprofile=coverage.out -covermode=atomic ./...
env:
HC_TEST_PYTHON: python3
# Never fails the job; needs the CODECOV_TOKEN secret unless tokenless upload is enabled.
- uses: codecov/codecov-action@v5
if: success()
with:
files: cli/coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Cross-compile
run: |
for p in linux/amd64 linux/arm64 darwin/arm64 windows/amd64; do
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PyPI
# Publishes integrations/testcontainers-python to PyPI as testcontainers-homecloud when a
# tag like testcontainers-python/v0.1.0 is pushed. Uses PyPI Trusted Publishing (OIDC):
# no API token is stored; PyPI trusts this workflow in the "pypi" environment.
on:
push:
tags:
- "testcontainers-python/v*"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: integrations/testcontainers-python
steps:
- uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check the tag matches the package version
run: |
tag="${GITHUB_REF_NAME#testcontainers-python/v}"
version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
test "$tag" = "$version" || { echo "::error::tag $tag does not match pyproject version $version"; exit 1; }
- run: python -m pip install build twine
- run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: integrations/testcontainers-python/dist/

publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/testcontainers-homecloud/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<p align="center">
<a href="https://github.com/solinode/homecloud/releases/latest"><img src="https://img.shields.io/github/v/release/solinode/homecloud?label=release" alt="Latest release"></a>
<a href="https://github.com/solinode/homecloud/actions/workflows/ci.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/solinode/homecloud/ci.yml?branch=main&label=CI" alt="CI status"></a>
<a href="https://codecov.io/gh/solinode/homecloud"><img src="https://codecov.io/gh/solinode/homecloud/branch/main/graph/badge.svg" alt="Coverage"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-blue" alt="License: AGPL-3.0"></a>
<a href="https://github.com/solinode/homecloud/pkgs/container/homecloud"><img src="https://img.shields.io/badge/docker-ghcr.io%2Fsolinode%2Fhomecloud-2496ED?logo=docker&logoColor=white" alt="Docker image: ghcr.io/solinode/homecloud"></a>
<a href="docs/compatibility.md"><img src="https://img.shields.io/badge/Terraform%20modules-17%2F17-7B42BC?logo=terraform&logoColor=white" alt="Terraform modules: 17 of 17 pass"></a>
Expand Down
42 changes: 42 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Codecov settings. Coverage comes from the go job in .github/workflows/ci.yml
# (cli/coverage.out). Status checks are informational: coverage never blocks a PR.
codecov:
require_ci_to_pass: false

coverage:
precision: 1
round: down
range: "50...85"
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
informational: true

comment:
layout: "condensed_header, diff, flags, files"
behavior: default
require_changes: false

# Paths in the profile are Go import paths; fixes map them back to the repository.
fixes:
- "github.com/homecloudhq/homecloud/cli/::cli/"

ignore:
- "cli/internal/web/dist/**"
- "console/**"
- "pages/**"
- "integrations/**"
- "examples/**"
- "compat/**"
- "scripts/**"
- "cli/internal/dockertest/**"
- "cli/internal/svc/svctest/**"
- "cli/internal/awsapi/awstest/**"
- "**/testdata/**"
- "**/*_test.go"
23 changes: 19 additions & 4 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ credentials it creates on first start. This page covers the ready-made integrati

| | |
| --- | --- |
| [GitHub Action](#github-actions) | `integrations/github-action`: install, start, export `AWS_*` |
| [GitHub Action](#github-actions) | [`solinode/setup-homecloud`](https://github.com/solinode/setup-homecloud): install, start, export `AWS_*` |
| [testcontainers-go](#testcontainers-go) | `integrations/testcontainers-go`: start HomeCloud from a Go test |
| [testcontainers-python](#testcontainers-python) | `integrations/testcontainers-python`: start HomeCloud from pytest |
| [testcontainers-python](#testcontainers-python) | `pip install testcontainers-homecloud`: start HomeCloud from pytest |
| [Plain binary or Docker](#plain-binary-or-docker) | anything else |

Everything HomeCloud runs (MinIO for S3, Lambda runtimes, databases) is a container on
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: solinode/homecloud/integrations/github-action@main
- uses: solinode/setup-homecloud@v1
with:
version: latest # or v0.3.0
services-wait: s3 # wait for MinIO too
Expand All @@ -43,7 +43,14 @@ serve` in the background (data and log under `$RUNNER_TEMP`), waits for
`AWS_SECRET_ACCESS_KEY` (masked), `AWS_REGION` and `AWS_DEFAULT_REGION`. After the job,
a post step prints the server log (collapsed), stops HomeCloud and removes its Docker
resources. Inputs, outputs and boto3/Terraform examples:
[integrations/github-action/README.md](../integrations/github-action/README.md).
[solinode/setup-homecloud](https://github.com/solinode/setup-homecloud#readme).

The action is published from its own repository,
[solinode/setup-homecloud](https://github.com/solinode/setup-homecloud) (`@v1` follows
compatible updates; pin `@v1.0.0` or a SHA for a fixed version). That repository is the
canonical home; [`integrations/github-action`](../integrations/github-action) is kept as a
copy for this repository's own tests. The older
`solinode/homecloud/integrations/github-action@main` reference still works.

## testcontainers-go

Expand All @@ -64,6 +71,14 @@ created. See [integrations/testcontainers-go/README.md](../integrations/testcont

## testcontainers-python

```sh
pip install testcontainers-homecloud
```

The package is available from PyPI after its first release; until then install it from
the repository:
`pip install "testcontainers-homecloud @ git+https://github.com/solinode/homecloud#subdirectory=integrations/testcontainers-python"`.

```python
from testcontainers_homecloud import HomeCloudContainer

Expand Down
17 changes: 12 additions & 5 deletions integrations/github-action/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Set up HomeCloud (GitHub Action)

> **The action now lives in its own repository:
> [solinode/setup-homecloud](https://github.com/solinode/setup-homecloud)**, which is
> what the GitHub Marketplace listing "Setup HomeCloud" points at. Use `uses: solinode/setup-homecloud@v1`.
> That repository is the canonical home and where releases are tagged; this directory is a
> mirror kept for HomeCloud's own CI (`.github/workflows/action-test.yml`). Make changes in
> both places. `solinode/homecloud/integrations/github-action@main` keeps working.

Runs [HomeCloud](https://github.com/solinode/homecloud), a self-hosted AWS, inside your
workflow so tests can call S3, SQS, DynamoDB, Lambda and the rest of the AWS API without
an AWS account.
Expand All @@ -23,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: solinode/homecloud/integrations/github-action@main
- uses: solinode/setup-homecloud@v1
with:
services-wait: s3
- run: aws s3 mb s3://my-bucket && aws s3 ls
Expand Down Expand Up @@ -54,7 +61,7 @@ AWS CLI v2 and current AWS SDKs read `AWS_ENDPOINT_URL`, so most tools need no c
### AWS CLI

```yaml
- uses: solinode/homecloud/integrations/github-action@main
- uses: solinode/setup-homecloud@v1
with:
services-wait: s3
- run: |
Expand All @@ -69,7 +76,7 @@ AWS CLI v2 and current AWS SDKs read `AWS_ENDPOINT_URL`, so most tools need no c
boto3 1.28 and later pick up `AWS_ENDPOINT_URL`:

```yaml
- uses: solinode/homecloud/integrations/github-action@main
- uses: solinode/setup-homecloud@v1
with:
services-wait: s3
- uses: actions/setup-python@v5
Expand All @@ -93,7 +100,7 @@ def test_upload():
The AWS provider (5.x and later) honours `AWS_ENDPOINT_URL`; tell it not to look for a real account:

```yaml
- uses: solinode/homecloud/integrations/github-action@main
- uses: solinode/setup-homecloud@v1
with:
services-wait: s3
- uses: hashicorp/setup-terraform@v3
Expand All @@ -112,7 +119,7 @@ provider "aws" {

```yaml
- id: homecloud
uses: solinode/homecloud/integrations/github-action@main
uses: solinode/setup-homecloud@v1
- run: ./run-tests.sh --endpoint "${{ steps.homecloud.outputs.endpoint }}"
```

Expand Down
Loading
Loading