github.com/solo-io/service-mesh-hub@v0.9.2/.github/workflows/pull_request.yaml (about)

     1  name: pull_request
     2  
     3  on:
     4    push:
     5      branches:
     6        - 'main'
     7    pull_request: {}
     8  
     9  jobs:
    10    check-code-gen:
    11      name: check-code-gen
    12      runs-on: ubuntu-18.04
    13      steps:
    14        - uses: actions/checkout@v2
    15        - run: |
    16            git fetch --prune --unshallow
    17        - name: Set up Go 1.14
    18          uses: actions/setup-go@v1
    19          with:
    20            go-version: 1.14
    21        - uses: actions/cache@v1
    22          with:
    23            path: ~/go/pkg/mod
    24            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    25            restore-keys: |
    26              ${{ runner.os }}-go-
    27        - name: Install Protoc
    28          uses: solo-io/setup-protoc@master
    29          with:
    30            version: '3.6.1'
    31            repo-token: ${{ secrets.GITHUB_TOKEN }}
    32        - name: Check code gen
    33          run: |
    34            ./ci/check-code-gen.sh
    35  
    36    unit-tests:
    37      name: unit-tests
    38      runs-on: ubuntu-18.04
    39      steps:
    40        - uses: actions/checkout@v2
    41        - run: |
    42            git fetch --prune --unshallow
    43        - name: Set up Go 1.14
    44          uses: actions/setup-go@v1
    45          with:
    46            go-version: 1.14
    47        - uses: actions/cache@v1
    48          with:
    49            path: ~/go/pkg/mod
    50            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    51            restore-keys: |
    52              ${{ runner.os }}-go-
    53        - name: Install Protoc
    54          uses: solo-io/setup-protoc@master
    55          with:
    56            version: '3.6.1'
    57            repo-token: ${{ secrets.GITHUB_TOKEN }}
    58        - name: Unit Tests
    59          run: |
    60            make install-go-tools run-tests
    61  
    62    e2e-istio:
    63      name: end-to-end-istio
    64      runs-on: ubuntu-18.04
    65      strategy:
    66        fail-fast: false
    67        matrix:
    68          istioctl-binary: [
    69            'https://github.com/istio/istio/releases/download/1.5.2/istio-1.5.2-linux.tar.gz',
    70            'https://github.com/istio/istio/releases/download/1.6.8/istio-1.6.8-linux-amd64.tar.gz',
    71            'https://github.com/istio/istio/releases/download/1.7.0/istio-1.7.0-linux-amd64.tar.gz',
    72            'https://github.com/istio/istio/releases/download/1.8.0-alpha.2/istio-1.8.0-alpha.2-linux-amd64.tar.gz'
    73          ]
    74      steps:
    75        - uses: actions/checkout@v2
    76        - run: |
    77            git fetch --prune --unshallow
    78        - name: Set up Go 1.14
    79          uses: actions/setup-go@v1
    80          with:
    81            go-version: 1.14
    82        - uses: engineerd/setup-kind@v0.4.0
    83          with:
    84            skipClusterCreation: "true"
    85            version: v0.8.0
    86        - name: Install Protoc
    87          uses: solo-io/setup-protoc@master
    88          with:
    89            version: '3.6.1'
    90            repo-token: ${{ secrets.GITHUB_TOKEN }}
    91        - uses: azure/setup-kubectl@v1
    92          with:
    93            version: 'v1.18.0'
    94        - uses: actions/cache@v1
    95          with:
    96            path: ~/go/pkg/mod
    97            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    98            restore-keys: |
    99              ${{ runner.os }}-go-
   100        - name: Clean
   101          run: make clean || true
   102        - name: e2e Tests
   103          env:
   104            RUN_E2E: "1"
   105            ISTIOCTL_BINARY: ${{ matrix.istioctl-binary }}
   106          run: |
   107            make print-version manifest-gen
   108  
   109            go install github.com/onsi/ginkgo/ginkgo
   110  
   111            ISTIO_VERSION=istio-$(echo $ISTIOCTL_BINARY | grep -o "download/.*/" | sed 's/\bdownload\b//g' |  sed 's/[\/]//g')
   112            curl -sSL $ISTIOCTL_BINARY | tar -xzf - $ISTIO_VERSION/bin/istioctl
   113            # move istio binary to _output, which is gitignored, to avoid `-dirty` suffix when computing version in subsequent makefile invocations
   114            mkdir _output && mv $ISTIO_VERSION _output/$ISTIO_VERSION
   115            export PATH=$PWD/_output/$ISTIO_VERSION/bin:/opt/hostedtoolcache/kubectl/1.18.0/x64:$PATH
   116            istioctl version
   117  
   118            make run-tests TEST_PKG=test/e2e/istio RUN_E2E=1 GINKGOFLAGS=-v
   119  
   120    e2e-osm:
   121      name: end-to-end-osm
   122      runs-on: ubuntu-18.04
   123      strategy:
   124        fail-fast: false
   125        matrix:
   126          osm-binary: [
   127            'https://github.com/openservicemesh/osm/releases/download/v0.3.0/osm-v0.3.0-linux-amd64.tar.gz',
   128            'https://github.com/openservicemesh/osm/releases/download/v0.4.0/osm-v0.4.0-linux-amd64.tar.gz',
   129          ]
   130      steps:
   131        - uses: actions/checkout@v2
   132        - run: |
   133            git fetch --prune --unshallow
   134        - name: Set up Go 1.14
   135          uses: actions/setup-go@v1
   136          with:
   137            go-version: 1.14
   138        - uses: engineerd/setup-kind@v0.4.0
   139          with:
   140            skipClusterCreation: "true"
   141            version: v0.8.0
   142        - name: Install Protoc
   143          uses: solo-io/setup-protoc@master
   144          with:
   145            version: '3.6.1'
   146            repo-token: ${{ secrets.GITHUB_TOKEN }}
   147        - uses: azure/setup-kubectl@v1
   148          with:
   149            version: 'v1.18.0'
   150        - uses: actions/cache@v1
   151          with:
   152            path: ~/go/pkg/mod
   153            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
   154            restore-keys: |
   155              ${{ runner.os }}-go-
   156        - name: Clean
   157          run: make clean || true
   158        - name: e2e Tests
   159          env:
   160            RUN_E2E: "1"
   161            OSM_BINARY: ${{ matrix.osm-binary }}
   162            OSM_VERSION: linux-amd64/osm
   163          run: |
   164            make print-version manifest-gen
   165  
   166            go install github.com/onsi/ginkgo/ginkgo
   167  
   168            curl -sSL $OSM_BINARY | tar -xzf - $OSM_VERSION
   169            # move istio binary to _output, which is gitignored, to avoid `-dirty` suffix when computing version in subsequent makefile invocations
   170            mkdir -p _output/.bin && mv $OSM_VERSION _output/.bin
   171            export PATH=$PWD/_output/.bin:/opt/hostedtoolcache/kubectl/1.18.0/x64:$PATH
   172            osm version
   173  
   174            make run-tests TEST_PKG=test/e2e/osm RUN_E2E=1 GINKGOFLAGS=-v