Skip to content

[release/1.1] Backport CI updates and enable CI on release 1.1 branch #398

[release/1.1] Backport CI updates and enable CI on release 1.1 branch

[release/1.1] Backport CI updates and enable CI on release 1.1 branch #398

Workflow file for this run

name: CI
on:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ 'main', 'release/**' ]
env:
GO_VERSION: 1.20.x
permissions:
contents: read
pull-requests: read
jobs:
#
# Project checks
#
project:
name: Project Checks
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: containerd/[email protected]
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]
go: [1.19.x, 1.20.x]
name: ${{ matrix.os }} / ${{ matrix.go }}
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Test
working-directory: src/github.com/containerd/ttrpc
run: |
go test -v -race -coverprofile="coverage.txt" -covermode=atomic ./...
protobuild:
name: Run Protobuild
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: src/github.com/containerd/ttrpc
fetch-depth: 25
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Setup Go binary path
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- 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 gogo/protobuf
run: |
cd $GOPATH/src
mkdir -p github.com/gogo
cd github.com/gogo
git clone --depth 1 --branch v1.3.2 https://github.com/gogo/protobuf
- name: Build protoc-gen-gogottrpc
working-directory: src/github.com/containerd/ttrpc
run: |
go build ./cmd/protoc-gen-gogottrpc
- name: Run Protobuild
working-directory: src/github.com/containerd/ttrpc
run: |
export PATH=$GOPATH/bin:$PWD:$PATH
go install github.com/containerd/protobuild@7e5ee24bc1f70e9e289fef15e2631eb3491320bf
cd example
protobuild
git diff --exit-code