Skip to content

build(deps): bump the actions group with 10 updates #167

build(deps): bump the actions group with 10 updates

build(deps): bump the actions group with 10 updates #167

Workflow file for this run

name: Go Tests
on:
pull_request: {}
push:
branches: [main]
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
outputs:
go: ${{ steps.filter.outputs.go }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Detect Go-relevant changes
id: filter
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
if [ "$EVENT_NAME" = "push" ]; then
echo "push to main: always run"
echo "go=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | \
grep -qE '^(cmd/lambda/|tests/integration/|\.github/workflows/go-tests\.yml$)'; then
echo "Go-relevant paths changed"
echo "go=true" >> "$GITHUB_OUTPUT"
else
echo "no Go-relevant changes"
echo "go=false" >> "$GITHUB_OUTPUT"
fi
go-test:
needs: changes
if: needs.changes.outputs.go == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: cmd/lambda
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: cmd/lambda/go.mod
- name: Test
run: go test -v -race ./...
go-dep-check:
needs: changes
if: needs.changes.outputs.go == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: tests/integration
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: tests/integration/go.mod
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...