-
Notifications
You must be signed in to change notification settings - Fork 583
56 lines (53 loc) · 1.55 KB
/
ci.yaml
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
name: ci
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
# Keep these versions in sync with the Dockerfile
BDR_VER: '6.0.1'
GO_VER: '1.21.x'
PGG_VER: 'v1.31.0'
PROTOC_VER: '24.3'
PYTHON_VER: '3.8'
TEST_TAG: protoc-gen-validate:${{ github.sha }}
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/bazelisk
~/.cache/bazel
~/.cache/protoc
key: ${{ runner.os }}-build-cache
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
cache: true
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VER }}
cache: 'pip'
- name: Install Dependencies
run: |
mkdir -p ~/.cache/protoc
PROTOC_ZIP="${HOME}/.cache/protoc/${PROTOC_VER}.zip"
if [[ ! -f "${PROTOC_ZIP}" ]]; then
curl -fsSL -o "${PROTOC_ZIP}" https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip
fi
unzip -q ${PROTOC_ZIP} -d ~/protoc
echo "${HOME}/protoc/bin" >> $GITHUB_PATH
go install google.golang.org/protobuf/cmd/protoc-gen-go@${PGG_VER}
go install github.com/bazelbuild/buildtools/buildozer@${BDR_VER}
pip install -r requirements.txt
- name: Build
run: make build
- name: Run
run: make ci