mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 02:16:28 +02:00
134 lines
3.6 KiB
YAML
134 lines
3.6 KiB
YAML
on: [push, 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
|
|
|
|
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: cache binaries
|
|
uses: actions/cache@v1
|
|
env:
|
|
cache-name: cache-binaries
|
|
with:
|
|
path: /opt/binaries/
|
|
key: ${{ runner.os }}-binaries
|
|
- name: install binaries
|
|
run: |
|
|
#!/bin/bash
|
|
sudo mkdir -p /usr/local/bin/
|
|
sudo mkdir -p /opt/minikube/bin/
|
|
cd /opt/minikube/bin
|
|
|
|
if [ ! -f minikube ]; then
|
|
echo "downloading minikube"
|
|
sudo curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
|
|
sudo chmod +x minikube
|
|
fi
|
|
sudo install minikube /usr/local/bin/
|
|
|
|
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: start minikube
|
|
run: |
|
|
minikube start --driver=docker
|
|
kubectl cluster-info
|
|
|
|
- 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/...
|