Skip to content

Fix template documentation comments (#610) #2483

Fix template documentation comments (#610)

Fix template documentation comments (#610) #2483

Workflow file for this run

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
- name: test
run: go test ./...
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@1.1.0
shfmt:
name: shfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-shfmt@v1.0.2
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: docker-meta-webserver
id: meta-webserver
uses: docker/metadata-action@v3
with:
images: |
sourcegraph/zoekt-webserver
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
- name: docker-meta-indexserver
id: meta-indexserver
uses: docker/metadata-action@v3
with:
images: |
sourcegraph/zoekt-indexserver
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
- name: build-zoekt
uses: docker/build-push-action@v4
with:
context: .
tags: "zoekt:latest"
push: "false"
build-args: VERSION=${{ steps.version.outputs.value }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build-push-webserver
uses: docker/build-push-action@v4
with:
context: .
tags: sourcegraph/zoekt-webserver:${{ steps.version.outputs.value }}, ${{ steps.meta-webserver.outputs.tags }}, sourcegraph/zoekt-webserver:latest
file: Dockerfile.webserver
cache-from: sourcegraph/zoekt-webserver:latest
push: true
- name: build-push-indexserver
uses: docker/build-push-action@v4
with:
context: .
tags: sourcegraph/zoekt-indexserver:${{ steps.version.outputs.value }}, ${{ steps.meta-indexserver.outputs.tags }}, sourcegraph/zoekt-indexserver:latest
file: Dockerfile.indexserver
cache-from: sourcegraph/zoekt-indexserver:latest
push: true
# We can only run this after a successful docker push otherwise the CI in sourcegraph will fail.
sync-zoekt:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- "docker"
steps:
- uses: actions/checkout@v3
with:
repository: 'sourcegraph/sourcegraph'
ref: 'main'
- uses: actions/setup-go@v2
with: { go-version: '1.19' }
- run: go mod download
- run: ./dev/zoekt/update
- uses: peter-evans/create-pull-request@v3
if: github.event_name == 'push'
name: 'Create PR'
id: pr
with:
token: ${{ secrets.GH_TOKEN }}
title: 'zoekt: update to sourcegraph/zoekt@${{ github.sha }}'
commit-message: 'zoekt: update to sourcegraph/zoekt@${{ github.sha }}'
body: |
This PR is autogenerated to update to sourcegraph/zoekt@${{ github.sha }}
## Test Plan
Testing is done on the zoekt repo. All checks on this PR are sufficient.
branch: 'zoekt/update'
delete-branch: 'true'
team-reviewers: 'search-team'
base: 'main'
- name: 'Check PR outputs'
run: |
echo "Pull Request Number - ${{ steps.pr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.pr.outputs.pull-request-url }}"
- uses: peter-evans/enable-pull-request-automerge@v1
name: Enable Pull Request Automerge
if: steps.pr.outputs.pull-request-operation == 'created'
with:
token: ${{ secrets.GH_TOKEN }}
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
merge-method: squash
repository: 'sourcegraph/sourcegraph'