-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.53 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: CGO_ENABLED=0 go build -o piping-server-check main/main.go
- name: Test
run: go test -v ./...
- name: Install piping-server to /tmp and create certificates
run: |
set -eu
cd /tmp
curl -L https://github.com/nwtgck/piping-server-pkg/releases/download/v1.12.8/piping-server-pkg-linuxstatic-x64.tar.gz | tar xzvf -
mv ./piping-server-pkg-linuxstatic-x64/piping-server .
(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/')
- name: Operational test
run: |
set -eu
./piping-server-check --http1.1 --http1.1-tls --h2 --tls-skip-verify --server-command='/tmp/piping-server --http-port=$HTTP_PORT --enable-https --https-port=$HTTPS_PORT --crt-path=/tmp/ssl_certs/server.crt --key-path=/tmp/ssl_certs/server.key'
- name: Operational test (error case)
run: |
set -eu
# Should fail because no --tls-skip-verify
! ./piping-server-check --http1.1 --http1.1-tls --server-command='/tmp/piping-server --http-port=$HTTP_PORT --enable-https --https-port=$HTTPS_PORT --crt-path=/tmp/ssl_certs/server.crt --key-path=/tmp/ssl_certs/server.key'