Skip to content

Test pipeline

Test pipeline #173

Workflow file for this run

name: Test pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Schedule the workflow to run at 01:30 AM every day
- cron: "30 01 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
testcontainers-go-version: ["v0.35.0", "main"]
name: 'Tests'
runs-on: 'ubuntu-latest'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Use testcontainers-go@${{ matrix.testcontainers-go-version }}
run: |
go get github.com/testcontainers/testcontainers-go/modules/compose@${{ matrix.testcontainers-go-version }}
go get github.com/testcontainers/testcontainers-go@${{ matrix.testcontainers-go-version }}
- name: modVerify
run: go mod verify
- name: modTidy
run: go mod tidy
- name: warm up Docker images
run: docker compose -f testdata/docker-compose.yml pull
- name: go test
timeout-minutes: 30
env:
# defines the timeout for Ryuk to receive the first connection (default: 60s). Value layout is described in time.ParseDuration documentation.
RYUK_CONNECTION_TIMEOUT: '120s'
# defines the timeout for Ryuk to reconnect to Docker (default: 10s). Value layout is described in time.ParseDuration documentation.
RYUK_RECONNECTION_TIMEOUT: '30s'
TESTCONTAINERS_RYUK_DISABLED: false
TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED: true
run: |
go test -v -race -count=1 ./...