pomerium/.github/workflows/test.yaml
Cuong Manh Le 26f099b49d
redis storage backend (#1082)
* pkg/storage: add redis storage backend

* pkg/storage/redis: set record create time correctly

* pkg/storage/redis: add docs

* pkg/storage/redis: run test with redis tag only

* pkg/storage/redis: use localhost

* pkg/storage/redis: use 127.0.0.1

* pkg/storage/redis: honor REDIS_URL env

* .github/workflows: add missing config for redis service

* .github/workflows: map redis ports to host

* pkg/storage/redis: use proto marshaler instead of json one

* pkg/storage/redis: use better implementation

By using redis supported datastructure:

 - Hash for storing record
 - Sorted set for storing by version
 - Set for storing deleted ids

List operation will be now performed in O(log(N)+M) instead of O(N) like
previous implementation.

* pkg/storage/redis: add tx to wrap redis transaction

* pkg/storage/redis: set record type in New

* pkg/storage/redis: make sure tx commands appear in right order

* pkg/storage/redis: make deletePermanentAfter as argument

* pkg/storage/redis: make sure version is incremented when deleting

* pkg/storage/redis: fix linter

* pkg/storage/redis: fix cmd construction
2020-07-22 03:07:20 +07:00

151 lines
3.6 KiB
YAML

on:
push:
branches:
- master
pull_request:
name: Test
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: Checkout code
uses: actions/checkout@v2
- name: Lint Dependencies
run: make build-deps
- name: Lint
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make lint
- name: Spellcheck
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make spellcheck
test:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, macos-latest, ubuntu-16.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build dependencies
run: make build-deps
- name: Test
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make test
cover:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: make cover
- name: CodeCov
uses: codecov/codecov-action@v1.0.4
with:
# The token below is used exclusively for uploading coverage reports.
token: "d82eb1d7-5990-4a31-baa4-156473402105"
file: ./coverage.txt
build:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, macos-latest, ubuntu-16.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: build
run: |
make build-deps
make build
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: build
run: docker build .
integration-tests:
runs-on: ubuntu-latest
steps:
- name: install mkcert
run: |
#!/bin/bash
if [ ! -f mkcert ]; then
echo "downloading mkcert"
sudo curl -Lo mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64
sudo chmod +x mkcert
fi
sudo install mkcert /usr/local/bin/
- name: Create kind cluster
uses: helm/kind-action@v1.0.0-rc.1
with:
cluster_name: kind
- name: install go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: checkout code
uses: actions/checkout@v2
- name: build dev docker image
run: |
./scripts/build-dev-docker.bash
- name: test
run: go test -v ./integration/...
storage-backend-test-redis:
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: install go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: checkout code
uses: actions/checkout@v2
- name: test
run: go test -v -tags redis ./pkg/storage/redis/...