-
Notifications
You must be signed in to change notification settings - Fork 143
142 lines (137 loc) · 4.22 KB
/
test-go.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: GoThemis
on:
pull_request:
paths:
- '.github/workflows/test-go.yaml'
- 'docs/examples/go/**'
- 'docs/reference-implementation/**'
- 'gothemis/**'
- 'src/soter/**'
- 'src/themis/**'
- 'tests/common/**'
- 'tests/reference-implementation/**'
- 'tests/test.mk'
- '**/*.mk'
- 'Makefile'
- '!**/README*'
push:
branches:
- master
- stable
- release/*
schedule:
- cron: '20 6 * * 1' # every Monday at 6:20 UTC
env:
WITH_FATAL_WARNINGS: yes
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-20.04
strategy:
matrix:
go:
- '1.11'
- '1.12'
- '1.13'
- '1.14'
- '1.15'
- '1.16'
- '1.17'
fail-fast: false
steps:
- name: Install system dependencies
run: |
sudo sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
sudo apt update
sudo apt install --yes gcc make libssl-dev
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- run: go version
- name: Check out code
uses: actions/checkout@v2
- name: Install Themis Core
run: |
make
sudo make install
- name: Run test suite (Go ${{ matrix.go }})
run: make test_go
examples:
name: Code examples
runs-on: ubuntu-20.04
steps:
- name: Install system dependencies
run: |
sudo sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
sudo apt update
sudo apt install --yes gcc make libssl-dev
- name: Install Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
- name: Check out code
uses: actions/checkout@v2
- name: Install Themis Core
run: |
make
sudo make install
- name: Test examples (Secure Cell)
run: |
cd $GITHUB_WORKSPACE/docs/examples/go
echo "Testing Secure Cell..."
go run secure_cell.go
echo "ok"
- name: Test examples (Secure Message)
run: |
cd $GITHUB_WORKSPACE/docs/examples/go
echo "Testing Secure Message..."
alice=($(go run secure_keygen.go))
bob=($(go run secure_keygen.go))
enc=$(go run secure_message.go enc "${alice[0]}" "${bob[1]}" message)
dec=$(go run secure_message.go dec "${bob[0]}" "${alice[1]}" "$enc")
test "$dec" = "message"
echo "ok"
- name: Test examples (Secure Session)
run: |
cd $GITHUB_WORKSPACE/docs/examples/go
echo "Testing Secure Session..."
go build secure_session_server.go
go build secure_session_client.go
./secure_session_server &
sleep 1 # give the server time to launch
./secure_session_client
kill -SIGTERM "$!"
echo "ok"
- name: Test examples (Secure Comparator)
run: |
cd $GITHUB_WORKSPACE/docs/examples/go
echo "Testing Secure Comparator..."
go build secure_comparator_server.go
go build secure_comparator_client.go
./secure_comparator_server secret &
sleep 1 # give the server time to launch
./secure_comparator_client secret
kill -SIGTERM "$!"
echo "ok"
reference-implementation:
name: Reference implementation
runs-on: ubuntu-20.04
steps:
- name: Install system dependencies
run: |
sudo sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
sudo apt update
sudo apt install --yes gcc make libssl-dev
- name: Check out code
uses: actions/checkout@v2
# Unit tests for reference implementation do not require neither GoThemis
# nor Themis Core to be installed. Do not install them before this step.
- name: Run unit test suite
run: cd docs/reference-implementation && go test -v ./...
- name: Install Themis Core
run: |
make
sudo make install
- name: Run integration test suite
run: cd tests/reference-implementation && go test -v ./...