Merge pull request #108 from squat/migrate_to_github_actions
.github/workflows: migrate to github actions
This commit is contained in:
commit
539a139a16
140
.github/workflows/ci.yml
vendored
Normal file
140
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Build
|
||||||
|
run: make
|
||||||
|
|
||||||
|
linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Build kg and kgctl for all Linux Architectures
|
||||||
|
run: make all-build
|
||||||
|
|
||||||
|
darwin:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Build kgctl for Darwin
|
||||||
|
run: make OS=darwin
|
||||||
|
|
||||||
|
windows:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Build kgctl for Windows
|
||||||
|
run: make OS=windows
|
||||||
|
|
||||||
|
unit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: make unit
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Lint Code
|
||||||
|
run: make lint
|
||||||
|
|
||||||
|
container:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Enable Experimental Docker CLI
|
||||||
|
run: |
|
||||||
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
||||||
|
sudo service docker restart
|
||||||
|
docker version -f '{{.Client.Experimental}}'
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
docker buildx version
|
||||||
|
- name: Container
|
||||||
|
run: make container
|
||||||
|
|
||||||
|
push:
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
- linux
|
||||||
|
- darwin
|
||||||
|
- windows
|
||||||
|
- unit
|
||||||
|
- lint
|
||||||
|
- container
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Enable Experimental Docker CLI
|
||||||
|
run: |
|
||||||
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
||||||
|
sudo service docker restart
|
||||||
|
docker version -f '{{.Client.Experimental}}'
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
docker buildx version
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@master
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- name: Build and push
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
run: make manifest
|
||||||
|
- name: Build and push latest
|
||||||
|
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||||
|
run: make manifest-latest
|
34
.travis.yml
34
.travis.yml
@ -1,34 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
|
|
||||||
dist: xenial
|
|
||||||
|
|
||||||
language: go
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
go:
|
|
||||||
- 1.14.2
|
|
||||||
|
|
||||||
env:
|
|
||||||
- GO111MODULE=on DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- sudo apt-get update && sudo apt-get -y install jq
|
|
||||||
|
|
||||||
install: true
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make
|
|
||||||
- make all-build
|
|
||||||
- make OS=darwin
|
|
||||||
- make OS=windows
|
|
||||||
- make clean
|
|
||||||
- make unit
|
|
||||||
- make lint
|
|
||||||
- make container
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
|
|
||||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
||||||
- make manifest && [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" == "master" ] && make manifest-latest
|
|
4
Makefile
4
Makefile
@ -39,7 +39,7 @@ OPENAPI_GEN_BINARY := bin/openapi-gen
|
|||||||
GOLINT_BINARY := bin/golint
|
GOLINT_BINARY := bin/golint
|
||||||
EMBEDMD_BINARY := bin/embedmd
|
EMBEDMD_BINARY := bin/embedmd
|
||||||
|
|
||||||
BUILD_IMAGE ?= golang:1.14.2-alpine
|
BUILD_IMAGE ?= golang:1.15.7-alpine
|
||||||
BASE_IMAGE ?= alpine:3.12
|
BASE_IMAGE ?= alpine:3.12
|
||||||
|
|
||||||
build: $(BINS)
|
build: $(BINS)
|
||||||
@ -197,7 +197,7 @@ header: .header
|
|||||||
FILES=; \
|
FILES=; \
|
||||||
for f in $(GO_FILES); do \
|
for f in $(GO_FILES); do \
|
||||||
for i in 0 1 2 3 4 5; do \
|
for i in 0 1 2 3 4 5; do \
|
||||||
FILE=$$(tail -n +$$i $$f | head -n $$HEADER_LEN | sed "s/[0-9]\{4\}/YEAR/"); \
|
FILE=$$(t=$$(mktemp) && tail -n +$$i $$f > $$t && head -n $$HEADER_LEN $$t | sed "s/[0-9]\{4\}/YEAR/"); \
|
||||||
[ "$$FILE" = "$$HEADER" ] && continue 2; \
|
[ "$$FILE" = "$$HEADER" ] && continue 2; \
|
||||||
done; \
|
done; \
|
||||||
FILES="$$FILES$$f "; \
|
FILES="$$FILES$$f "; \
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Kilo is a multi-cloud network overlay built on WireGuard and designed for Kubernetes.
|
Kilo is a multi-cloud network overlay built on WireGuard and designed for Kubernetes.
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/squat/kilo.svg?branch=master)](https://travis-ci.org/squat/kilo)
|
[![Build Status](https://github.com/squat/kilo/workflows/CI/badge.svg)](https://github.com/squat/kilo/actions?query=workflow%3ACI)
|
||||||
[![Go Report Card](https://goreportcard.com/badge/github.com/squat/kilo)](https://goreportcard.com/report/github.com/squat/kilo)
|
[![Go Report Card](https://goreportcard.com/badge/github.com/squat/kilo)](https://goreportcard.com/report/github.com/squat/kilo)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
Loading…
Reference in New Issue
Block a user