-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (67 loc) · 1.72 KB
/
Copy pathci.yaml
File metadata and controls
78 lines (67 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Run ${{ matrix.target }}
run: make -f lint.Makefile ${{ matrix.target }}
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- 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