Skip to content
Latchkey

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

The Go Tests workflow from aws/aws-sdk-go-v2, 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: aws/aws-sdk-go-v2.github/workflows/go.ymlLicense Apache-2.0View source

What it does

This is the Go 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: Go Tests

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
      - 'feat-**'


permissions:
  contents: read

env:
  EACHMODULE_CONCURRENCY: 2
  SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go
  GIT_PAT: ${{ secrets.CI_GIT_PAT}}

jobs:
  unix-tests:
    name: Unix SDK tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        go-version: ["1.24", "1.25", "1.26"]
    steps:
    - uses: actions/checkout@v2

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

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

    - name: Install golint
      run: go install golang.org/x/lint/golint@latest

    - name: Test
      run: make ci-test-no-generate

  x86-tests:
    name: Unix x86 SDK tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        go-version: ["1.24"]
    env:
      GOARCH: "386"
    steps:
    - uses: actions/checkout@v2

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

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

    - name: Install golint
      run: go install golang.org/x/lint/golint@latest

    - name: Test
      run: make ci-test-no-generate-no-race

  windows-tests:
    name: Windows SDK Tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest]
        go-version: ["1.24", "1.25", "1.26"]
    env:
      EACHMODULE_SKIP: "internal\\repotools\\changes"
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      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: Test
      run: make ci-test-no-generate

The same workflow, on Latchkey

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

name: Go Tests
 
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
      - 'feat-**'
 
 
permissions:
  contents: read
 
env:
  EACHMODULE_CONCURRENCY: 2
  SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go
  GIT_PAT: ${{ secrets.CI_GIT_PAT}}
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  unix-tests:
    timeout-minutes: 30
    name: Unix SDK tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        go-version: ["1.24", "1.25", "1.26"]
    steps:
    - uses: actions/checkout@v2
 
    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
 
    - name: Find smithy-go
      env:
        RUNNER_TMPDIR: ${{ runner.temp }}
      run: ./ci-find-smithy-go.sh
 
    - name: Install golint
      run: go install golang.org/x/lint/golint@latest
 
    - name: Test
      run: make ci-test-no-generate
 
  x86-tests:
    timeout-minutes: 30
    name: Unix x86 SDK tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        go-version: ["1.24"]
    env:
      GOARCH: "386"
    steps:
    - uses: actions/checkout@v2
 
    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
 
    - name: Find smithy-go
      env:
        RUNNER_TMPDIR: ${{ runner.temp }}
      run: ./ci-find-smithy-go.sh
 
    - name: Install golint
      run: go install golang.org/x/lint/golint@latest
 
    - name: Test
      run: make ci-test-no-generate-no-race
 
  windows-tests:
    timeout-minutes: 30
    name: Windows SDK Tests
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest]
        go-version: ["1.24", "1.25", "1.26"]
    env:
      EACHMODULE_SKIP: "internal\\repotools\\changes"
    steps:
    - uses: actions/checkout@v2
 
    - name: Set up Go
      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: Test
      run: make ci-test-no-generate
 

What changed

This workflow runs 3 jobs (10 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow