forked from xvandish/zoekt
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (117 loc) · 3.58 KB
/
ci.yml
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
120
121
122
123
124
125
126
127
on:
push:
branches:
- main
pull_request:
name: CI
jobs:
test:
runs-on: ubuntu-latest
container: alpine:edge # go1.19 needs > alpine 3.15
steps:
- name: checkout
uses: actions/checkout@v3
- name: add dependencies
run: apk add go git
- name: install ctags
run: ./install-ctags-alpine.sh
# Needed for submodule tests in gitindex
- name: git protocol.file.allow
run: git config --global --replace-all protocol.file.allow always
- name: test
run: go test ./...
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/[email protected]
shfmt:
name: shfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/[email protected]
with:
filter_mode: "nofilter"
fail_on_error: "true"
shfmt_flags: "-i 2 -ci -bn"
# lint-protos:
# name: "buf lint"
# runs-on: ubuntu-latest
# steps:
# # Run `git checkout`
# - uses: actions/checkout@v2
# # Install the `buf` CLI
# - uses: bufbuild/buf-setup-action@v1
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# # Lint your Protobuf sources
# - run: .github/workflows/buf-lint-check.sh
# format-protos:
# name: "buf format"
# runs-on: ubuntu-latest
# steps:
# # Run `git checkout`
# - uses: actions/checkout@v2
# # Install the `buf` CLI
# - uses: bufbuild/buf-setup-action@v1
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# # Check to see if the Protobuf sources are formatted
# - run: .github/workflows/buf-format-check.sh
# generate-protos:
# name: "buf generate"
# runs-on: ubuntu-latest
# steps:
# # Run `git checkout`
# - uses: actions/checkout@v2
# # Install the `buf` CLI
# - uses: bufbuild/buf-setup-action@v1
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# # Check if the generated code is up-to-date
# - run: .github/workflows/buf-generate-check.sh
# We build a shared docker image called "zoekt". This is not pushed, but is
# used for creating the indexserver and webserver images.
docker:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- "test"
- "shellcheck"
steps:
- name: checkout
uses: actions/checkout@v3
- name: version
id: version
run: .github/workflows/docker-version.sh
- name: build-zoekt
uses: docker/build-push-action@v1
with:
repository: zoekt
tags: "latest"
add_git_labels: "true"
push: "false"
build_args: VERSION=${{ steps.version.outputs.value }}
- name: build-push-webserver
uses: docker/build-push-action@v1
with:
repository: xvandish/zoekt-webserver
tags: ${{ steps.version.outputs.value }},latest
dockerfile: Dockerfile.webserver
add_git_labels: "true"
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build-push-indexserver
uses: docker/build-push-action@v1
with:
repository: xvandish/zoekt-indexserver
tags: ${{ steps.version.outputs.value }},latest
dockerfile: Dockerfile.indexserver
add_git_labels: "true"
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}