Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from cruise-automation/github-actions
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
dustin-decker committed Nov 14, 2019
2 parents 14a9799 + 3c35462 commit 562869e
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,82 @@
name: CI

on: [pull_request]

jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
runs-on: ubuntu-latest

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Test
run: make test

benchmark:
strategy:
matrix:
go-version: [1.13.x]
runs-on: ubuntu-latest

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Benchmark
run: GO111MODULE=on CGO_ENABLED=0 go test -benchmem -run=^$ github.com/cruise-automation/k-rail/server -bench .

# lint:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# go-version: [1.13.x]

# steps:

# - name: Set up Go ${{ matrix.go-version }}
# uses: actions/setup-go@v1
# with:
# go-version: ${{ matrix.go-version }}

# - name: Check out code into the Go module directory
# uses: actions/checkout@v1

# - name: Lint
# uses: matoous/golangci-lint-action@v1.1.0
# # with:
# # config: .golangci.yml

build:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
runs-on: ubuntu-latest

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Build
run: make build
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -17,4 +17,5 @@ build:
GO111MODULE=on CGO_ENABLED=0 go build -o k-rail cmd/main.go

test:
GO111MODULE=on CGO_ENABLED=0 go test -cover $(shell go list ./... | grep -v /vendor/)
GO111MODULE=on CGO_ENABLED=1 go test -race -cover $(shell go list ./... | grep -v /vendor/)

1 change: 1 addition & 0 deletions README.md
@@ -1,5 +1,6 @@
![k-rail](images/k-rail.png)

[![CI Status](https://github.com/cruise-automation/k-rail/workflows/CI/badge.svg)](https://github.com/cruise-automation/k-rail/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/cruise-automation/k-rail)](https://goreportcard.com/report/github.com/cruise-automation/k-rail)
[![Docker Hub Build Status](https://img.shields.io/docker/cloud/build/cruise/k-rail.svg)](https://hub.docker.com/r/cruise/k-rail/)

Expand Down

0 comments on commit 562869e

Please sign in to comment.