mirror of
https://github.com/hanzoai/grpc-web.git
synced 2026-11-02 08:46:49 +00:00
Per the standing fork rule, a hanzoai fork declares its OWN module path and is required directly -- never resolved via a `replace` against the upstream path. Keeping the upstream path meant every consumer's import line carried the upstream brand. module github.com/traefik/grpc-web -> module github.com/hanzoai/grpc-web All occurrences were import paths (package self-imports plus the test servers and the react example server). go/grpcweb -- the package Hanzo Ingress links -- is green.
151 lines
5.6 KiB
YAML
151 lines
5.6 KiB
YAML
version: 2.1
|
|
|
|
executors:
|
|
test-executor:
|
|
docker:
|
|
- image: circleci/golang:1.16.2
|
|
auth:
|
|
username: mydockerhub-user
|
|
password: $DOCKERHUB_PASSWORD
|
|
environment:
|
|
BUF_VER: 0.40.0
|
|
PROTOC_VER: 3.15.6
|
|
working_directory: /go/src/github.com/hanzoai/grpc-web
|
|
|
|
jobs:
|
|
# This first job in the workflow optimises test time by combining the following:
|
|
# * Linting
|
|
# * Golang unit tests
|
|
# * TypeScript unit tests
|
|
# * Builds integration testserver binary
|
|
# * Builds integration test Javascript bundles
|
|
initial-unit-test-lint-prebuild:
|
|
executor: test-executor
|
|
steps:
|
|
- checkout
|
|
- run: sudo apt-get install unzip
|
|
- run: . ./install-buf.sh
|
|
- run: . ./install-protoc.sh
|
|
- run: echo 'export GOBIN=/go/bin' >> $BASH_ENV
|
|
- run: go get golang.org/x/tools/cmd/goimports
|
|
- run: go get github.com/robertkrimen/godocdown/godocdown
|
|
- run: go mod tidy # removes dependencies added by tool installations
|
|
- run: go install github.com/golang/protobuf/protoc-gen-go
|
|
- run:
|
|
command: |
|
|
set +e
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.33.5/install.sh | bash
|
|
export NVM_DIR="/home/circleci/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
nvm install
|
|
echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV
|
|
echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV
|
|
- run: npm install
|
|
# Verify test files are correctly generated
|
|
- run: cd integration_test && npm run build:proto && git diff --exit-code
|
|
# Lint
|
|
- run: ./lint-all.sh
|
|
# Unit Tests
|
|
- run: ./test-all.sh
|
|
# Build server binary and Javascript bundles to be used across all subsequent browser tests
|
|
- run:
|
|
name: Pre-Build Integration Test
|
|
command: npm run build:integration
|
|
# Persisting the workspace allows the built assets to be used across the fan-out tests in the subsequent step
|
|
- persist_to_workspace:
|
|
root: /go/src/github.com/hanzoai/grpc-web
|
|
paths:
|
|
- integration_test
|
|
- client
|
|
browser-tests:
|
|
parameters:
|
|
browser-params:
|
|
type: string
|
|
executor: test-executor
|
|
steps:
|
|
- checkout
|
|
# Attaches the workspace from the previous step to retrieve the built assets for the tests
|
|
- attach_workspace:
|
|
at: /go/src/github.com/hanzoai/grpc-web
|
|
- run: sudo apt-get install moreutils
|
|
# The two following hosts must match those in integration_test/hosts-config.ts
|
|
- run: echo 127.0.0.1 testhost | sudo tee -a /etc/hosts
|
|
- run: echo 127.0.0.1 corshost | sudo tee -a /etc/hosts
|
|
- run:
|
|
command: |
|
|
set +e
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.33.5/install.sh | bash
|
|
export NVM_DIR="/home/circleci/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
nvm install
|
|
echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV
|
|
echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV
|
|
- run: << parameters.browser-params >> npm run test:integration-browsers:ci
|
|
- store_test_results:
|
|
path: ./integration_test/test-results
|
|
- store_artifacts:
|
|
path: ./integration_test/sauce-connect-proxy/logs
|
|
workflows:
|
|
version: 2
|
|
test-workflow:
|
|
jobs:
|
|
- initial-unit-test-lint-prebuild
|
|
# Split browser test matrix into separate jobs to keep parallelism
|
|
# to a maximum of 5 jobs, the maximum number of parallel jobs
|
|
# our SauceLabs configuration allows.
|
|
- browser-tests:
|
|
matrix:
|
|
alias: browser-tests-first
|
|
parameters:
|
|
browser-params:
|
|
- BROWSER=firefox86_win
|
|
- BROWSER=firefox39_win DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=firefox38_win DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=chrome_89
|
|
- BROWSER=chrome_52
|
|
requires:
|
|
- initial-unit-test-lint-prebuild
|
|
- browser-tests:
|
|
matrix:
|
|
alias: browser-tests-second
|
|
parameters:
|
|
browser-params:
|
|
- BROWSER=chrome_43
|
|
- BROWSER=chrome_42
|
|
- BROWSER=chrome_41
|
|
- BROWSER=edge88_win
|
|
- BROWSER=edge16_win
|
|
requires:
|
|
- browser-tests-first
|
|
- browser-tests:
|
|
matrix:
|
|
alias: browser-tests-third
|
|
parameters:
|
|
browser-params:
|
|
- BROWSER=edge14_win
|
|
- BROWSER=edge13_win
|
|
- BROWSER=safari14 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=safari13_1 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=safari12_1 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
requires:
|
|
- browser-tests-second
|
|
- browser-tests:
|
|
matrix:
|
|
alias: browser-tests-fourth
|
|
parameters:
|
|
browser-params:
|
|
- BROWSER=safari11_1 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=safari10_1 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=safari9_1 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=safari8 SC_SSL_BUMPING=true DISABLE_WEBSOCKET_TESTS=true
|
|
- BROWSER=ie11_win DISABLE_WEBSOCKET_TESTS=true
|
|
requires:
|
|
- browser-tests-third
|
|
- browser-tests:
|
|
matrix:
|
|
parameters:
|
|
browser-params:
|
|
- BROWSER=nodejs
|
|
requires:
|
|
- browser-tests-fourth
|