Skip to content

Commit

Permalink
feat: ✨ package completed
Browse files Browse the repository at this point in the history
  • Loading branch information
jfelipearaujo committed Jun 8, 2024
1 parent 945d9b2 commit 08c3386
Show file tree
Hide file tree
Showing 44 changed files with 4,371 additions and 181 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- "v*.*.*"
- 'v*.*.*-*.*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
workdir: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x

- name: Run Tests 01
run: make run-tests-01

- name: Run Tests 02
run: make run-tests-02

- name: Run Tests 03
run: make run-tests-03

- name: Run Tests 04
run: make run-tests-04

- name: Run Tests 05
run: make run-tests-05

- name: Run Tests 06
run: make run-tests-06
37 changes: 37 additions & 0 deletions .gomarkdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
output: "{{.Dir}}/README.md"
header: |-
# testcontainers
This is an addon to be used with Testcontainers package and with GoDog
## Installation
```bash
go get github.com/jfelipearaujo/testcontainers@latest
```
## How to use
To use this addon, you need to import the packages in your project:
```go
import "github.com/jfelipearaujo/testcontainers/pkg/container"
import "github.com/jfelipearaujo/testcontainers/pkg/network"
import "github.com/jfelipearaujo/testcontainers/pkg/state"
import "github.com/jfelipearaujo/testcontainers/pkg/testsuite"
```
# Examples
| Example | Description |
| --- | --- |
| [Example 01](./examples/example_01/README.md) | Simple BDD test.
| [Example 02](./examples/example_02/README.md) | Using a Postgres container.
| [Example 03](./examples/example_03/README.md) | Using aLocalStack container.
| [Example 04](./examples/example_04/README.md) | Using a MongoDB container.
| [Example 05](./examples/example_05/README.md) | Custom API running on a container via Dockerfile.
| [Example 06](./examples/example_06/README.md) | Two containers interacting with each other using a Network.
# Full documentation
repository:
url: https://github.com/jfelipearaujo/testcontainers
defaultBranch: main
path: /
39 changes: 35 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
test-example-01:
go test -race -count=1 ./examples/example_01/... -test.v -test.run ^TestFeatures$
gen-docs:
@echo "Generating docs..."
gomarkdoc -o README.md ./pkg/...

test-example-02:
go test -race -count=1 ./examples/example_02/... -test.v -test.run ^TestFeatures$
run-tests:
@echo "Running tests..."
make run-tests-01
make run-tests-02
make run-tests-03
make run-tests-04
make run-tests-05
make run-tests-06

run-tests-01:
@echo "Running tests for example 01..."
@go test -race -count=1 ./examples/example_01/... -timeout=300s -test.v -test.run ^TestFeatures$

run-tests-02:
@echo "Running tests for example 02..."
@go test -race -count=1 ./examples/example_02/... -timeout=300s -test.v -test.run ^TestFeatures$

run-tests-03:
@echo "Running tests for example 03..."
@go test -race -count=1 ./examples/example_03/... -timeout=300s -test.v -test.run ^TestFeatures$

run-tests-04:
@echo "Running tests for example 04..."
@go test -race -count=1 ./examples/example_04/... -timeout=300s -test.v -test.run ^TestFeatures$

run-tests-05:
@echo "Running tests for example 05..."
@go test -race -count=1 ./examples/example_05/... -timeout=300s -test.v -test.run ^TestFeatures$

run-tests-06:
@echo "Running tests for example 06..."
@go test -race -count=1 ./examples/example_06/... -timeout=300s -test.v -test.run ^TestFeatures$
Loading

0 comments on commit 08c3386

Please sign in to comment.