go get build-lambda-zip workflow (aws/aws-lambda-go)
The go get build-lambda-zip workflow from aws/aws-lambda-go, 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 →What it does
This is the go get build-lambda-zip workflow from the aws/aws-lambda-go 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 get build-lambda-zip
on:
push:
branches:
- master
schedule:
- cron: "7 7 * * *"
jobs:
thejob:
runs-on: ${{ matrix.platform }}
name: install build-lambda-zip on ${{ matrix.platform }}
strategy:
matrix:
go-version: [1.12, 1.13]
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: go get
env:
GOPROXY: direct
GO111MODULE: on
run: |
go env
go get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: go get build-lambda-zip on: push: branches: - master schedule: - cron: "7 7 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: thejob: timeout-minutes: 30 runs-on: ${{ matrix.platform }} name: install build-lambda-zip on ${{ matrix.platform }} strategy: matrix: go-version: [1.12, 1.13] platform: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Setup Go uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - name: go get env: GOPROXY: direct GO111MODULE: on run: | go env go get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job (6 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.