Skip to content
Latchkey

interop workflow (terramate-io/terramate)

The interop workflow from terramate-io/terramate, explained and optimized by Latchkey.

C

CI health: C - fair

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: terramate-io/terramate.github/workflows/interop-tests.ymlLicense MPL-2.0View source

What it does

This is the interop workflow from the terramate-io/terramate repository, a real project running GitHub Actions. It is shown here with attribution under its MPL-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
# Copyright 2023 Terramate GmbH
# SPDX-License-Identifier: MPL-2.0

name: interop
on:
  push:
    branches:
      - main
    paths:
      - '**.go'
      - '**.tm'
      - '**.tm.hcl'
  workflow_dispatch:

jobs:
  interop-tests:
    permissions:
      id-token: write # This is required for requesting the JWT
      contents: read # This is required for actions/checkout
      checks: read # This is required for fetching check runs.

    runs-on: blacksmith-4vcpu-ubuntu-2404

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4

      - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5
        with:
          go-version-file: 'go.mod'
          check-latest: true

      - name: run interop tests
        run: go test -v -count=1 -tags interop ./e2etests/cloud/interop/...
        env:
          TMC_API_HOST: api.stg.terramate.io
          TM_CLOUD_ORGANIZATION: test
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

# Copyright 2023 Terramate GmbH
# SPDX-License-Identifier: MPL-2.0
 
name: interop
on:
  push:
    branches:
      - main
    paths:
      - '**.go'
      - '**.tm'
      - '**.tm.hcl'
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  interop-tests:
    timeout-minutes: 30
    permissions:
      id-token: write # This is required for requesting the JWT
      contents: read # This is required for actions/checkout
      checks: read # This is required for fetching check runs.
 
    runs-on: blacksmith-4vcpu-ubuntu-2404
 
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
 
      - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5
        with:
          go-version-file: 'go.mod'
          check-latest: true
 
      - name: run interop tests
        run: go test -v -count=1 -tags interop ./e2etests/cloud/interop/...
        env:
          TMC_API_HOST: api.stg.terramate.io
          TM_CLOUD_ORGANIZATION: test
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow