From 4d55137ef49d85c2288b212c6a3b2048c24a70e6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Wed, 4 Nov 2020 08:33:18 +0100 Subject: [PATCH] Enable Web tests and make sure to install right channel (#390) --- .github/workflows/dart.yml | 20 +++++++++++++++++++- tool/install-grpcwebproxy.sh | 19 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 9002fdd..0490b2b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -50,12 +50,30 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [stable, dev] + platform: [vm, chrome] + exclude: + # We only run Chrome tests on Linux. No need to run them + # on Windows and Mac because they are platform independent. + - os: windows-latest + platform: chrome + - os: macos-latest + platform: chrome steps: - uses: actions/checkout@v2 - uses: cedx/setup-dart@v2 + with: + release-channel: ${{ matrix.sdk }} - name: Report version run: dart --version + - name: Install grpcwebproxy + if: ${{ matrix.platform == 'chrome' }} + run: | + ./tool/install-grpcwebproxy.sh + echo "/tmp/grpcwebproxy" >> $GITHUB_PATH + env: + MATRIX_OS: ${{ matrix.os }} + shell: bash - name: Install dependencies run: dart pub get - name: Run tests - run: dart test + run: dart test --platform ${{ matrix.platform }} diff --git a/tool/install-grpcwebproxy.sh b/tool/install-grpcwebproxy.sh index be3a03d..be5a24d 100755 --- a/tool/install-grpcwebproxy.sh +++ b/tool/install-grpcwebproxy.sh @@ -1,7 +1,10 @@ #!/bin/sh +set -ex + VERSION=v0.13.0 SUFFIX= +WGET=wget case $TRAVIS_OS_NAME in linux) @@ -16,9 +19,23 @@ case $TRAVIS_OS_NAME in ;; esac +case $MATRIX_OS in + ubuntu-latest) + VARIANT=linux-x86_64 + ;; + macos-latest) + VARIANT=osx-x86_64 + ;; + windows-latest) + VARIANT=win64.exe + SUFFIX=.exe + WGET=C:/msys64/usr/bin/wget.exe + ;; +esac + BINARY=grpcwebproxy-${VERSION}-${VARIANT} -wget https://github.com/improbable-eng/grpc-web/releases/download/${VERSION}/${BINARY}.zip -O /tmp/grpcwebproxy.zip +${WGET} https://github.com/improbable-eng/grpc-web/releases/download/${VERSION}/${BINARY}.zip -O /tmp/grpcwebproxy.zip rm -rf /tmp/grpcwebproxy mkdir /tmp/grpcwebproxy cd /tmp/grpcwebproxy