Repository navigation
119 lines (101 loc) · 4.02 KB
/
Copy pathci.yml
File metadata and controls
119 lines (101 loc) · 4.02 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
plans-empty:
name: Plans directory is empty
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Check plans directory
run: test ! -d plans || test -z "$(find plans -type f -print -quit)"
go-quality:
name: Go quality and lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Bazelisk
shell: bash
run: |
bazelisk_dir="${RUNNER_TEMP}/bazelisk"
mkdir -p "${bazelisk_dir}"
curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/bazelisk-linux-amd64" -o "${bazelisk_dir}/bazel"
printf '%s %s\n' '5a408715e932c0250d28bd84555f12edbf70117de42f9181691c736eacc4a992' "${bazelisk_dir}/bazel" | sha256sum -c -
chmod +x "${bazelisk_dir}/bazel"
echo "${bazelisk_dir}" >> "${GITHUB_PATH}"
- name: Check formatting
run: |
bazel run @rules_go//go -- fmt ./...
git diff --exit-code
- name: Test
run: |
git --version
git merge-tree --write-tree "--merge-base=HEAD^{tree}" "HEAD^{tree}" "HEAD^{tree}"
bazel test --test_env=PATH //...
- name: Vet
run: bazel run @rules_go//go -- vet ./...
- name: Run golangci-lint
run: bazel run @rules_go//go -- run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.0 run
integration:
name: Integration (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- platform: windows-amd64
runner: windows-2025
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: darwin-amd64
runner: macos-15-intel
- platform: darwin-arm64
runner: macos-15
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Bazelisk
shell: bash
run: |
case "${RUNNER_OS}-${RUNNER_ARCH}" in
Linux-X64) asset="bazelisk-linux-amd64"; sha256="5a408715e932c0250d28bd84555f12edbf70117de42f9181691c736eacc4a992" ;;
Linux-ARM64) asset="bazelisk-linux-arm64"; sha256="e20e8b0f4f240091b7a55bf17b9398bd4f40ee70ae0208dff95dd4c445fb4010" ;;
macOS-X64) asset="bazelisk-darwin-amd64"; sha256="16c3d7aa15323a9fb69f56c7ec5733ed18bedb786680d0ba13bb12a3c8083007" ;;
macOS-ARM64) asset="bazelisk-darwin-arm64"; sha256="cee851f726789227d5561004e9904a52be45c3efb56f8b38b6993d6adbaa0409" ;;
Windows-X64) asset="bazelisk-windows-amd64.exe"; sha256="092a8738d5b41aae7a85c42cc961b1034e3389aba43ffc20c0fabda7b43e095b" ;;
*) echo "Unsupported runner: ${RUNNER_OS}-${RUNNER_ARCH}" >&2; exit 1 ;;
esac
bazelisk_dir="${RUNNER_TEMP//\\//}/bazelisk"
mkdir -p "${bazelisk_dir}"
executable=bazel
if [[ "${RUNNER_OS}" == Windows ]]; then executable=bazel.exe; fi
curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/${asset}" -o "${bazelisk_dir}/${executable}"
if [[ "${RUNNER_OS}" == macOS ]]; then
printf '%s %s\n' "${sha256}" "${bazelisk_dir}/${executable}" | shasum -a 256 -c -
else
printf '%s %s\n' "${sha256}" "${bazelisk_dir}/${executable}" | sha256sum -c -
fi
chmod +x "${bazelisk_dir}/${executable}"
echo "${bazelisk_dir}" >> "${GITHUB_PATH}"
- name: Test integration
run: |
git --version
git merge-tree --write-tree "--merge-base=HEAD^{tree}" "HEAD^{tree}" "HEAD^{tree}"
bazel test --test_env=PATH //integration/...
ci-success:
name: CI success
runs-on: ubuntu-latest
needs:
- plans-empty
- go-quality
- integration
steps:
- name: Confirm CI succeeded
run: echo "All CI checks passed"