Skip to content

AtomicJar/testcontainers-cloud-setup-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testcontainers Cloud action

This action downloads and runs the agent. Either token parameter or TC_CLOUD_TOKEN environment variable is required.

Example usage

name: Java CI with Maven

on:
  push:
    branches: [ main ]

jobs:
  build:
    name: "Run checks"
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-java@v3
        with:
          java-version: '8.0.345'
          distribution: temurin
          
      # Setup Testcontainers Cloud Client right before your Testcontainers tests
      - name: Setup Testcontainers Cloud Client
        uses: atomicjar/testcontainers-cloud-setup-action@v1
        with:
          token: ${{ secrets.TC_CLOUD_TOKEN }}
          
      - name: Build with Maven
        run: mvn -V -B verify

      # (Optionally) When you don't need Testcontainers anymore, you could terminate sessions eagerly
      - name: Terminate Testcontainers Cloud Client active sessions
        uses: atomicjar/testcontainers-cloud-setup-action@v1
        with:
          action: terminate

Configurable parameters

  • token (required): secret-string - service account token for Testcontainers Cloud
  • version (optional): latest (default) - Testcontainers Cloud binary version
  • wait (optional): true/false (default) - if action should wait until agent successfully connects to Testcontainers Cloud in advance
  • args (optional): string - flags/arguments of the agent to pass as is. Consult with the knowledge base to find out more about possible options.
  • logfile (optional): string - file to write the agent output instead of the standard out.
  • action (optional): prepare (default) / terminate - action could be specified explicitly to terminate sessions eagerly.
  • project-key (optional): GITHUB_REPOSITORY (default) - project identifier
  • project-url (optional): GITHUB_SERVER_URL/GITHUB_REPOSITORY (default) - project's url