...

Text file src/github.com/containerd/ttrpc/.github/workflows/ci.yml

Documentation: github.com/containerd/ttrpc/.github/workflows

     1name: CI
     2
     3on:
     4  push:
     5    branches: [ main ]
     6  pull_request:
     7    branches: [ main ]
     8
     9env:
    10  GO_VERSION: 1.20.x
    11
    12permissions:
    13  contents: read
    14  pull-requests: read
    15
    16jobs:
    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@v3
    31        with:
    32          path: src/github.com/containerd/ttrpc
    33
    34      - uses: actions/setup-go@v3
    35        with:
    36          go-version: ${{ env.GO_VERSION }}
    37
    38      - name: golangci-lint
    39        uses: golangci/golangci-lint-action@v3
    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/setup-go@v3
    61        with:
    62          go-version: ${{ env.GO_VERSION }}
    63
    64      - uses: actions/checkout@v3
    65        with:
    66          path: src/github.com/containerd/ttrpc
    67          fetch-depth: 25
    68
    69      - uses: containerd/project-checks@v1.1.0
    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: 5
    86    steps:
    87
    88    - uses: actions/setup-go@v3
    89      with:
    90        go-version: ${{ matrix.go }}
    91
    92    - name: Check out code
    93      uses: actions/checkout@v3
    94      with:
    95        path: src/github.com/containerd/ttrpc
    96        fetch-depth: 25
    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    - uses: actions/setup-go@v3
   123      with:
   124        go-version: ${{ env.GO_VERSION }}
   125      id: go
   126
   127    - name: Setup Go binary path
   128      shell: bash
   129      run: |
   130        echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
   131        echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
   132
   133    - name: Check out code
   134      uses: actions/checkout@v3
   135      with:
   136        path: src/github.com/containerd/ttrpc
   137        fetch-depth: 25
   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

View as plain text