Skip to content

Align with Go binary template #3

Align with Go binary template

Align with Go binary template #3

Workflow file for this run

---
name: CI
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- yamllint
- actionlint
- modernize
- golangci-lint
- shfmt
- license
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run ${{ matrix.target }}
run: make -f lint.Makefile ${{ matrix.target }}
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Install dependencies
run: sudo ./hack/install-deps.sh dev
- name: Run tests
run: go test ./...
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build binary
run: |
docker buildx create --use
docker buildx bake binary \
--set "*.cache-from=type=gha,scope=ci-build" \
--set "*.cache-to=type=gha,mode=max,scope=ci-build"
success:
runs-on: ubuntu-latest
needs:
- lint
- test
- build
if: always()
steps:
- name: Check CI result
run: |
for result in ${{ join(needs.*.result, ' ') }}; do
if [[ "$result" != "success" ]]; then
exit 1
fi
done