Skip to content

GoThemis

GoThemis #1296

Workflow file for this run

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 ./...