Skip to content
Latchkey

Codegen Tests workflow (aws/aws-sdk-go-v2)

The Codegen Tests workflow from aws/aws-sdk-go-v2, explained and optimized by Latchkey.

D

CI health: D - needs work

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: aws/aws-sdk-go-v2.github/workflows/codegen.ymlLicense Apache-2.0View source

What it does

This is the Codegen Tests workflow from the aws/aws-sdk-go-v2 repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

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

The workflow

workflow (.yml)
name: Codegen Tests

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]


permissions:
  contents: read

env:
  # get owner of the repository. used by forks.
  SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go

jobs:
  codegen-test:
    name: SDK Codegen Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        go-version: ["1.24"]
    env:
      JAVA_TOOL_OPTIONS: "-Xmx2g"
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: Download Coretto 17 JDK
      run: |
        download_url="https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz"
        wget -O $RUNNER_TEMP/java_package.tar.gz $download_url

    - name: Set up Coretto 17 JDK
      uses: actions/setup-java@v2
      with:
        distribution: 'jdkfile'
        jdkFile: ${{ runner.temp }}/java_package.tar.gz
        java-version: 17
        architecture: x64

    - uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}

    - name: Find smithy-go
      shell: bash
      env:
        RUNNER_TMPDIR: ${{ runner.temp }}
      run: ./ci-find-smithy-go.sh

    - name: Build and publish smithy-go
      working-directory: ${{ runner.temp }}/smithy-go
      run: make smithy-publish-local

    - name: Cleanup smithy-go
      run: rm -rf ${{ runner.temp }}/smithy-go

    - name: SDK Codegen
      run: make smithy-generate

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Codegen Tests
 
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
 
 
permissions:
  contents: read
 
env:
  # get owner of the repository. used by forks.
  SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  codegen-test:
    timeout-minutes: 30
    name: SDK Codegen Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        go-version: ["1.24"]
    env:
      JAVA_TOOL_OPTIONS: "-Xmx2g"
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
 
    - name: Download Coretto 17 JDK
      run: |
        download_url="https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz"
        wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
 
    - name: Set up Coretto 17 JDK
      uses: actions/setup-java@v2
      with:
        cache: 'maven'
        distribution: 'jdkfile'
        jdkFile: ${{ runner.temp }}/java_package.tar.gz
        java-version: 17
        architecture: x64
 
    - uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
 
    - name: Find smithy-go
      shell: bash
      env:
        RUNNER_TMPDIR: ${{ runner.temp }}
      run: ./ci-find-smithy-go.sh
 
    - name: Build and publish smithy-go
      working-directory: ${{ runner.temp }}/smithy-go
      run: make smithy-publish-local
 
    - name: Cleanup smithy-go
      run: rm -rf ${{ runner.temp }}/smithy-go
 
    - name: SDK Codegen
      run: make smithy-generate
 
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

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