github.com/newrelic/go-agent@v3.26.0+incompatible/.github/workflows/ci.yaml (about)

     1  # Copyright 2020 New Relic Corporation. All rights reserved.
     2  # SPDX-License-Identifier: Apache-2.0
     3  
     4  name: Go Agent CI
     5  
     6  on: pull_request
     7  
     8  jobs:
     9    go-agent-v3:
    10      runs-on: ubuntu-latest
    11      env:
    12        # Required when using older versions of Go that do not support gomod.
    13        GOPATH: ${{ github.workspace }}
    14  
    15      strategy:
    16        # if one test fails, do not abort the rest
    17        fail-fast: false
    18        matrix:
    19          include:
    20            - go-version: 1.19.x
    21              dirs: v3/newrelic,v3/internal,v3/examples
    22            - go-version: 1.20.x
    23              dirs: v3/newrelic,v3/internal,v3/examples
    24            - go-version: 1.21.x
    25              dirs: v3/newrelic,v3/internal,v3/examples
    26  
    27            # v3 integrations
    28            - go-version: 1.19.x
    29              dirs: v3/integrations/nrsarama
    30            - go-version: 1.19.x
    31              dirs: v3/integrations/logcontext/nrlogrusplugin
    32                #            extratesting: go get -u github.com/sirupsen/logrus@master
    33            - go-version: 1.19.x
    34              dirs: v3/integrations/logcontext-v2/nrlogrus
    35                #            extratesting: go get -u github.com/sirupsen/logrus@master
    36            - go-version: 1.19.x
    37              dirs: v3/integrations/logcontext-v2/nrzerolog
    38              extratesting: go get -u github.com/rs/zerolog@master
    39            - go-version: 1.19.x
    40              dirs: v3/integrations/logcontext-v2/nrzap
    41            - go-version: 1.19.x
    42              dirs: v3/integrations/logcontext-v2/nrwriter
    43            - go-version: 1.19.x
    44              dirs: v3/integrations/logcontext-v2/zerologWriter
    45              extratesting: go get -u github.com/rs/zerolog@master
    46            - go-version: 1.19.x
    47              dirs: v3/integrations/logcontext-v2/logWriter
    48            - go-version: 1.19.x
    49              dirs: v3/integrations/nrawssdk-v1
    50              extratesting: go get -u github.com/aws/aws-sdk-go@main
    51            - go-version: 1.19.x
    52              dirs: v3/integrations/nrawssdk-v2
    53              extratesting: go get -u github.com/aws/aws-sdk-go-v2@main
    54            - go-version: 1.19.x
    55              dirs: v3/integrations/nrecho-v3
    56              # Test against the latest v3 Echo:
    57              extratesting: go get -u github.com/labstack/echo@v3
    58              # go/new/http no longer stable under go 1.18.x
    59            - go-version: 1.19.x
    60              dirs: v3/integrations/nrecho-v4
    61              extratesting: go get -u github.com/labstack/echo/v4@master
    62            - go-version: 1.19.x
    63              dirs: v3/integrations/nrelasticsearch-v7
    64              extratesting: go get -u github.com/elastic/go-elasticsearch/v7@7.x
    65            - go-version: 1.19.x
    66              dirs: v3/integrations/nrgin
    67              extratesting: go get -u github.com/gin-gonic/gin@master
    68            - go-version: 1.19.x
    69              dirs: v3/integrations/nrgorilla
    70              extratesting: go get -u github.com/gorilla/mux@master
    71            - go-version: 1.19.x
    72              dirs: v3/integrations/nrgraphgophers
    73            - go-version: 1.19.x
    74              dirs: v3/integrations/nrlogrus
    75            - go-version: 1.19.x
    76              dirs: v3/integrations/nrlogxi
    77              extratesting: go get -u github.com/mgutz/logxi@master
    78            - go-version: 1.19.x
    79              dirs: v3/integrations/nrpkgerrors
    80              extratesting: go get -u github.com/pkg/errors@master
    81            - go-version: 1.19.x
    82              dirs: v3/integrations/nrlambda
    83              extratesting: go get -u github.com/aws/aws-lambda-go@master
    84            - go-version: 1.19.x
    85              dirs: v3/integrations/nrmysql
    86              extratesting: go get -u github.com/go-sql-driver/mysql@master
    87            - go-version: 1.19.x
    88              dirs: v3/integrations/nrpq
    89              extratesting: go get -u github.com/lib/pq@master
    90            - go-version: 1.19.x
    91              dirs: v3/integrations/nrpgx5
    92            - go-version: 1.19.x
    93              dirs: v3/integrations/nrpq/example/sqlx
    94            - go-version: 1.19.x
    95              dirs: v3/integrations/nrredis-v7
    96              extratesting: go get -u github.com/go-redis/redis/v7@master
    97            - go-version: 1.19.x
    98              dirs: v3/integrations/nrredis-v9
    99              extratesting: go get -u github.com/redis/go-redis/v9@master
   100            - go-version: 1.19.x
   101              dirs: v3/integrations/nrsqlite3
   102              extratesting: go get -u github.com/mattn/go-sqlite3@master
   103            - go-version: 1.19.x
   104              dirs: v3/integrations/nrsnowflake
   105            - go-version: 1.19.x
   106              dirs: v3/integrations/nrgrpc
   107              extratesting: go get -u google.golang.org/grpc@master
   108            - go-version: 1.19.x
   109              dirs: v3/integrations/nrmicro
   110              # As of Dec 2019, there is a race condition in when using go-micro@master
   111              # in their logging system.  Instead, we'll test against the latest
   112              # released version.
   113              # As of Jan 2019, it is impossible to go get the latest micro version.
   114              # As of June 2020, confirmed errors still result
   115              # extratesting: go get -u github.com/micro/go-micro@latest
   116              # If we are using the latest released version to test, we need to use a newer version of go
   117            - go-version: 1.19.x
   118              dirs: v3/integrations/nrnats
   119              extratesting: go get -u github.com/nats-io/nats.go/@master
   120            - go-version: 1.19.x
   121              dirs: v3/integrations/nrstan
   122              extratesting: go get -u github.com/nats-io/stan.go/@master
   123            - go-version: 1.19.x
   124              dirs: v3/integrations/nrstan/test
   125            - go-version: 1.19.x
   126              dirs: v3/integrations/nrstan/examples
   127            - go-version: 1.19.x
   128              dirs: v3/integrations/logcontext
   129              extratesting: go get -u github.com/sirupsen/logrus@master
   130              # nrzap only supports the two most recent minor go releases
   131            - go-version: 1.19.x
   132              dirs: v3/integrations/nrzap
   133            - go-version: 1.19.x
   134              dirs: v3/integrations/nrhttprouter
   135              extratesting: go get -u github.com/julienschmidt/httprouter@master
   136            - go-version: 1.19.x
   137              dirs: v3/integrations/nrb3
   138            - go-version: 1.19.x
   139              dirs: v3/integrations/nrmongo
   140              extratesting: go get -u go.mongodb.org/mongo-driver@master
   141            - go-version: 1.19.x
   142              dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example
   143              extratesting: go get -u github.com/graphql-go/graphql@master
   144            - go-version: 1.19.x
   145              dirs: v3/integrations/nrmssql
   146              extratesting: go get -u github.com/microsoft/go-mssqldb@main
   147  
   148      steps:
   149      - name: Install Go
   150        uses: actions/setup-go@v1
   151        with:
   152          go-version: ${{ matrix.go-version }}
   153  
   154      - name: Checkout Code
   155        uses: actions/checkout@v1
   156        with:
   157          # Required when using older versions of Go that do not support gomod.
   158          # Note the required presence of the /go-agent/ directory at the
   159          # beginning of this path.  It is required in order to match the
   160          # ${{ github.workspace }} used by the GOPATH env var.  pwd when cloning
   161          # the repo is <something>/go-agent/ whereas ${{ github.workspace }}
   162          # returns <something/go-agent/go-agent/.
   163          path: ./go-agent/src/github.com/newrelic/go-agent
   164  
   165      - name: Run Tests
   166        run: bash v3/build-script.sh
   167        env:
   168          DIRS: ${{ matrix.dirs }}
   169          EXTRATESTING: ${{ matrix.extratesting }}
   170          PIN: ${{ matrix.pin }}
   171      - name: Upload coverage to Codecov
   172        uses: codecov/codecov-action@v3
   173  
   174    go-agent-arm64:
   175      # Run all unit tests on aarch64 emulator to ensure compatibility with AWS
   176      # Graviton instances
   177      runs-on: ubuntu-latest
   178      strategy:
   179      # if one test fails, do not abort the rest
   180        fail-fast: false
   181        matrix:
   182          include:
   183            - go-version: 1.19.x
   184      steps:
   185      - uses: actions/checkout@v1
   186        with:
   187          # Required when using older versions of Go that do not support gomod.
   188          # Note the required presence of the /go-agent/ directory at the
   189          # beginning of this path.  It is required in order to match the
   190          # ${{ github.workspace }} used by the GOPATH env var.  pwd when cloning
   191          # the repo is <something>/go-agent/ whereas ${{ github.workspace }}
   192          # returns <something/go-agent/go-agent/.
   193          path: ./go-agent/src/github.com/newrelic/go-agent
   194      - uses: uraimo/run-on-arch-action@v2.0.5
   195        name: Run Tests
   196        id: runcmd
   197        with:
   198          arch: aarch64
   199          distro: ubuntu20.04
   200          githubToken: ${{ github.token }}
   201          install: |
   202            DEBIAN_FRONTEND=noninteractive apt-get -qq update
   203            DEBIAN_FRONTEND=noninteractive apt-get -qq install -y wget build-essential
   204            wget -nv https://golang.org/dl/go${{ matrix.go-version }}.linux-arm64.tar.gz
   205            rm -rf /usr/local/go
   206            tar -C /usr/local -xzf go${{ matrix.go-version }}.linux-arm64.tar.gz
   207          run: |
   208            export PATH=$PATH:/usr/local/go/bin
   209            go version
   210            cd v3/newrelic
   211            go mod download github.com/golang/protobuf
   212            go get -t
   213            echo ==== v3/newrelic tests ====
   214            go test ./...
   215            cd ../internal
   216            echo ==== v3/internal tests ====
   217            go test ./...
   218            cd ../examples
   219            echo ==== v3/examples tests ====
   220            go test ./...