-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add CircleCI setting for piping-server-check
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Why CircleCI? Because Node 18 on GitHub Actions fails. Transfer via Piping Server for about 25 seconds fails by TCP RST. Node 12, 14, 16 work fine on GitHub Actions. | ||
|
||
version: 2.1 | ||
|
||
orbs: | ||
node: circleci/[email protected] | ||
|
||
executors: | ||
linux: | ||
machine: | ||
image: ubuntu-2004:202107-02 | ||
|
||
jobs: | ||
test: | ||
parameters: | ||
node-version: | ||
type: string | ||
environment: | ||
PIPING_SERVER_CHECK_VERSION: 0.11.0 | ||
executor: linux | ||
steps: | ||
- checkout | ||
- node/install: | ||
node-version: << parameters.node-version >> | ||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm run build | ||
- run: npm test | ||
- run: | ||
name: Create certificates | ||
command: cd /tmp && mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/' | ||
- run: | ||
name: Install piping-server-check | ||
command: cd /tmp && wget -O piping-server-check.deb https://github.com/nwtgck/piping-server-check/releases/download/v${PIPING_SERVER_CHECK_VERSION}/piping-server-check-${PIPING_SERVER_CHECK_VERSION}-linux-amd64.deb && sudo dpkg -i piping-server-check.deb | ||
- run: | ||
name: piping-server-check | ||
command: piping-server-check --http1.1 --http1.1-tls --h2 --tls-skip-verify --compromise get_cancel_get --concurrency 100 --server-command="${SERVER_COMMAND}" --n-simultaneous-requests=60 --transfer-speed-byte $((1024 * 1024 * 1024 * 1024)) --transfer-span 3s --transfer-span 10s --transfer-span 1m | ||
environment: | ||
SERVER_COMMAND: 'mkdir -p /tmp/logs && exec node ./dist/src/index.js --http-port=$HTTP_PORT --enable-https=true --https-port=$HTTPS_PORT --key-path=/tmp/ssl_certs/server.key --crt-path=/tmp/ssl_certs/server.crt 2>&1 | tee /tmp/logs/$(date "+%s%3N").log > /dev/stderr' | ||
no_output_timeout: 3m | ||
- run: | ||
when: always | ||
name: Show server logs from piping-server-check | ||
command: tail -n +1 /tmp/logs/* | ||
|
||
workflows: | ||
all-tests: | ||
jobs: | ||
- test: | ||
matrix: | ||
parameters: | ||
node-version: ["14", "16", "18"] |