ttrpc/.github/workflows/ci.yml
Kazuyoshi Kato d240c5005f Use google.golang.org/protobuf instead of github.com/gogo/protobuf
This change replaces github.com/gogo/protobuf with
google.golang.org/protobuf, except for the code generators.

All proto-encoded structs are now generated from .proto files,
which include ttrpc.Request and ttrpc.Response.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-02-16 23:11:27 +00:00

140 lines
3.1 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: read
jobs:
#
# golangci-lint
#
linters:
name: Linters
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
go-version: [1.17]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
args: --timeout=5m
only-new-issues: true
- name: golangci-lint errors
run: golangci-lint run
if: ${{ failure() }}
#
# Project checks
#
project:
name: Project Checks
runs-on: ubuntu-18.04
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- uses: containerd/project-checks@v1
with:
working-directory: src/github.com/containerd/ttrpc
#
# Build and Test project
#
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Check out code
uses: actions/checkout@v2
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- name: Test
working-directory: src/github.com/containerd/ttrpc
run: |
go test -v -race ./...
#
# Run Protobuild
#
protobuild:
name: Run Protobuild
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go
- name: Setup Go binary path
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
uses: actions/checkout@v2
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- name: Install protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip
sudo unzip -x protoc-3.5.0-linux-x86_64.zip -d /usr/local
sudo chmod -R go+rX /usr/local/include
sudo chmod go+x /usr/local/bin/protoc
- name: Install protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
- name: Build protoc-gen-go-ttrpc
working-directory: src/github.com/containerd/ttrpc
run: |
go build ./cmd/protoc-gen-go-ttrpc
- name: Run Protobuild
working-directory: src/github.com/containerd/ttrpc
run: |
export PATH=$GOPATH/bin:$PWD:$PATH
go install github.com/containerd/protobuild@7e5ee24bc1f70e9e289fef15e2631eb3491320bf
protobuild
(cd example && protobuild)
git diff --exit-code