Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya authored Jun 28, 2024
2 parents de7c0d9 + 865a70e commit 21280a2
Show file tree
Hide file tree
Showing 185 changed files with 4,221 additions and 2,012 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ jobs:
id: go

- name: golangci-lint
# TODO: Remove each example/module once it passes the golangci-lint
if: ${{ inputs.platform == 'ubuntu-latest' && inputs.go-version == '1.20.x' }}
if: ${{ inputs.platform == 'ubuntu-latest' }}
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.55.2
version: v1.59.1
# Optional: working directory, useful for monorepos
working-directory: ${{ inputs.project-directory }}
# Optional: golangci-lint command line arguments.
Expand All @@ -92,7 +91,7 @@ jobs:

- name: modTidy
working-directory: ./${{ inputs.project-directory }}
run: make tools-tidy
run: make tidy

- name: ensure compilation
working-directory: ./${{ inputs.project-directory }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
matrix:
go-version: [1.21.x, 1.x]
platform: [ubuntu-latest]
module: [artemis, cassandra, chroma, clickhouse, cockroachdb, compose, consul, couchbase, dolt, elasticsearch, gcloud, inbucket, influxdb, k3s, k6, kafka, localstack, mariadb, milvus, minio, mockserver, mongodb, mssql, mysql, nats, neo4j, ollama, openfga, openldap, opensearch, postgres, pulsar, qdrant, rabbitmq, redis, redpanda, registry, surrealdb, vault, weaviate]
module: [artemis, azurite, cassandra, chroma, clickhouse, cockroachdb, compose, consul, couchbase, dolt, elasticsearch, gcloud, inbucket, influxdb, k3s, k6, kafka, localstack, mariadb, milvus, minio, mockserver, mongodb, mssql, mysql, nats, neo4j, ollama, openfga, openldap, opensearch, postgres, pulsar, qdrant, rabbitmq, redis, redpanda, registry, surrealdb, vault, vearch, weaviate]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: ${{ matrix.go-version }}
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/docker-moby-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Tests against Latest Docker Moby

on:
schedule:
# nightly build, at 23:59 CEST
- cron: '59 23 * * *'

jobs:
test_latest_moby:
strategy:
matrix:
rootless-docker: [true, false]
name: "Core tests using latest moby/moby"
runs-on: 'ubuntu-latest'
continue-on-error: true
steps:
- name: Set the Docker Install type
run: |
echo "docker_install_type=${{ matrix.rootless-docker == true && 'Rootless' || 'Rootful' }}" >> "$GITHUB_ENV"
- name: Setup rootless Docker
if: ${{ matrix.rootless-docker }}
uses: ScribeMD/rootless-docker@6bd157a512c2fafa4e0243a8aa87d964eb890886 # v0.2.2

- name: Remove Docker root socket
if: ${{ matrix.rootless-docker }}
run: sudo rm -rf /var/run/docker.sock

- name: Check out code into the Go module directory
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
id: go

- name: modVerify
run: go mod verify

- name: modTidy
run: go mod tidy

- name: Install Latest Docker
run: curl https://get.docker.com | CHANNEL=test sh

- name: go test
timeout-minutes: 30
run: make test-unit

- name: Create slack payload file
if: failure()
run: |
cat <<EOF > ./payload-slack-content.json
{
"tc_project": "testcontainers-go",
"tc_docker_install_type": "${docker_install_type}",
"tc_github_action_url": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}",
"tc_github_action_status": "FAILED",
"tc_slack_channel_id": "${{ secrets.SLACK_DOCKER_LATEST_CHANNEL_ID }}"
}
- name: Notify to Slack on failures
if: failure()
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
payload-file-path: "./payload-slack-content.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOCKER_LATEST_WEBHOOK }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ src/pip-delete-this-directory.txt

TEST-*.xml

tcvenv

**/go.work
8 changes: 8 additions & 0 deletions .vscode/.testcontainers-go.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"name": "module / artemis",
"path": "../modules/artemis"
},
{
"name": "module / azurite",
"path": "../modules/azurite"
},
{
"name": "module / cassandra",
"path": "../modules/cassandra"
Expand Down Expand Up @@ -169,6 +173,10 @@
"name": "module / vault",
"path": "../modules/vault"
},
{
"name": "module / vearch",
"path": "../modules/vearch"
},
{
"name": "module / weaviate",
"path": "../modules/weaviate"
Expand Down
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,32 @@ test-all: tools test-tools test-unit
.PHONY: test-examples
test-examples:
@echo "Running example tests..."
make -C examples test
$(MAKE) -C examples test

.PHONY: tidy-all
tidy-all:
make -C examples tidy-examples
make -C modules tidy-modules
$(MAKE) tidy
$(MAKE) -C examples tidy-examples
$(MAKE) -C modules tidy-modules

## -------------------------------------

TCENV=tcvenv
PYTHONBIN=./$(TCENV)/bin

tcvenv: tcvenv/touchfile

tcvenv/touchfile:
@echo "Creating docs $(TCENV)..."
test -d $(TCENV) || python3 -m venv $(TCENV)
@echo "Installing requirements..."
. $(PYTHONBIN)/activate; pip install -Ur requirements.txt
touch $(TCENV)/touchfile

clean-docs:
@echo "Destroying docs $(TCENV)..."
rm -rf $(TCENV)

.PHONY: serve-docs
serve-docs: tcvenv
. $(PYTHONBIN)/activate; $(PYTHONBIN)/mkdocs serve
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ verify_ssl = true
[packages]
mkdocs = "==1.5.3"
mkdocs-codeinclude-plugin = "==0.2.1"
mkdocs-include-markdown-plugin = "==6.0.4"
mkdocs-include-markdown-plugin = "==6.0.7"
mkdocs-material = "==9.5.18"
mkdocs-markdownextradata-plugin = "==0.2.5"

Expand Down
106 changes: 55 additions & 51 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions commons-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define go_install
endef

$(GOBIN)/golangci-lint:
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2)
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1)

$(GOBIN)/gotestsum:
$(call go_install,gotest.tools/gotestsum@latest)
Expand Down Expand Up @@ -47,6 +47,6 @@ tools:
.PHONY: test-tools
test-tools: $(GOBIN)/gotestsum

.PHONY: tools-tidy
tools-tidy:
.PHONY: tidy
tidy:
go mod tidy
Loading

0 comments on commit 21280a2

Please sign in to comment.