| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ main ] |
| 6 |
pull_request: |
| 7 |
branches: [ main ] |
| 8 |
|
| 9 |
env: |
| 10 |
GO_VERSION: 1.20.x |
| 11 |
|
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
pull-requests: read |
| 15 |
|
| 16 |
jobs: |
| 17 |
# |
| 18 |
# golangci-lint |
| 19 |
# |
| 20 |
linters: |
| 21 |
name: Linters |
| 22 |
runs-on: ${{ matrix.os }} |
| 23 |
timeout-minutes: 10 |
| 24 |
|
| 25 |
strategy: |
| 26 |
matrix: |
| 27 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 28 |
|
| 29 |
steps: |
| 30 |
- uses: actions/checkout@v4 |
| 31 |
with: |
| 32 |
path: src/github.com/containerd/ttrpc |
| 33 |
|
| 34 |
- uses: actions/setup-go@v5 |
| 35 |
with: |
| 36 |
go-version: ${{ env.GO_VERSION }} |
| 37 |
|
| 38 |
- name: golangci-lint |
| 39 |
uses: golangci/golangci-lint-action@v4 |
| 40 |
with: |
| 41 |
version: v1.51.2 |
| 42 |
args: --timeout=5m |
| 43 |
skip-cache: true |
| 44 |
working-directory: src/github.com/containerd/ttrpc |
| 45 |
|
| 46 |
- name: golangci-lint errors |
| 47 |
run: golangci-lint run |
| 48 |
working-directory: src/github.com/containerd/ttrpc |
| 49 |
if: ${{ failure() }} |
| 50 |
|
| 51 |
# |
| 52 |
# Project checks |
| 53 |
# |
| 54 |
project: |
| 55 |
name: Project Checks |
| 56 |
runs-on: ubuntu-22.04 |
| 57 |
timeout-minutes: 5 |
| 58 |
|
| 59 |
steps: |
| 60 |
- uses: actions/checkout@v4 |
| 61 |
with: |
| 62 |
path: src/github.com/containerd/ttrpc |
| 63 |
fetch-depth: 25 |
| 64 |
|
| 65 |
- uses: actions/setup-go@v5 |
| 66 |
with: |
| 67 |
go-version: ${{ env.GO_VERSION }} |
| 68 |
|
| 69 |
- uses: containerd/[email protected] |
| 70 |
with: |
| 71 |
working-directory: src/github.com/containerd/ttrpc |
| 72 |
|
| 73 |
# |
| 74 |
# Build and Test project |
| 75 |
# |
| 76 |
build: |
| 77 |
strategy: |
| 78 |
fail-fast: false |
| 79 |
matrix: |
| 80 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 81 |
go: [1.19.x, 1.20.x] |
| 82 |
|
| 83 |
name: ${{ matrix.os }} / ${{ matrix.go }} |
| 84 |
runs-on: ${{ matrix.os }} |
| 85 |
timeout-minutes: 10 |
| 86 |
steps: |
| 87 |
|
| 88 |
- name: Check out code |
| 89 |
uses: actions/checkout@v4 |
| 90 |
with: |
| 91 |
path: src/github.com/containerd/ttrpc |
| 92 |
fetch-depth: 25 |
| 93 |
|
| 94 |
- uses: actions/setup-go@v5 |
| 95 |
with: |
| 96 |
go-version: ${{ matrix.go }} |
| 97 |
|
| 98 |
- name: Test |
| 99 |
working-directory: src/github.com/containerd/ttrpc |
| 100 |
run: | |
| 101 |
make test |
| 102 |
|
| 103 |
- name: Coverage |
| 104 |
working-directory: src/github.com/containerd/ttrpc |
| 105 |
run: | |
| 106 |
make coverage TESTFLAGS_RACE=-race |
| 107 |
|
| 108 |
- name: Integration Tests |
| 109 |
working-directory: src/github.com/containerd/ttrpc |
| 110 |
run: | |
| 111 |
make integration |
| 112 |
|
| 113 |
# |
| 114 |
# Run Protobuild |
| 115 |
# |
| 116 |
protobuild: |
| 117 |
name: Run Protobuild |
| 118 |
runs-on: ubuntu-22.04 |
| 119 |
timeout-minutes: 5 |
| 120 |
steps: |
| 121 |
|
| 122 |
- name: Check out code |
| 123 |
uses: actions/checkout@v4 |
| 124 |
with: |
| 125 |
path: src/github.com/containerd/ttrpc |
| 126 |
fetch-depth: 25 |
| 127 |
|
| 128 |
- uses: actions/setup-go@v5 |
| 129 |
with: |
| 130 |
go-version: ${{ env.GO_VERSION }} |
| 131 |
id: go |
| 132 |
|
| 133 |
- name: Setup Go binary path |
| 134 |
shell: bash |
| 135 |
run: | |
| 136 |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV |
| 137 |
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH |
| 138 |
|
| 139 |
- name: Install dependencies |
| 140 |
working-directory: src/github.com/containerd/ttrpc |
| 141 |
run: | |
| 142 |
sudo make install-protobuf |
| 143 |
make install-protobuild |
| 144 |
|
| 145 |
- name: Install protoc-gen-go-ttrpc |
| 146 |
working-directory: src/github.com/containerd/ttrpc |
| 147 |
run: | |
| 148 |
make install |
| 149 |
|
| 150 |
- name: Run Protobuild |
| 151 |
working-directory: src/github.com/containerd/ttrpc |
| 152 |
run: | |
| 153 |
make check-protos |