Github Action simple CI

This commit is contained in:
Yann Hamon 2020-05-31 21:16:18 +02:00
parent c4ab3e29b2
commit bc3d13148e
4 changed files with 21 additions and 43 deletions

View file

@ -1,33 +1,17 @@
# This is a basic workflow to help you get started with Actions
name: build
name: CI
on: push
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: checkout
uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
- name: test
run: make docker-test
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
- name: build
run: make docker-build-static

View file

@ -1,10 +1,19 @@
#!/usr/bin/make -f
build:
go build -o bin/kubeconform
test-build: test build
test:
go test ./...
build:
go build -o bin/kubeconform
build-static:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeconform
docker-test:
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make test
docker-build-static:
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make build-static

View file

@ -1,5 +1,7 @@
# Kubeconform
![Build status](https://github.com/yannh/kubeconform/workflows/build/badge.svg)
Kubeconform is a Kubernetes manifests validation tool. Build it into your CI to validate your Kubernetes
configuration using the schemas from the registry maintained by the
[kubernetes-json-schema](https://github.com/instrumenta/kubernetes-json-schema) project!

View file

@ -1,17 +0,0 @@
name: kubeconform
on:
push:
branches: [ master ]
jobs:
build:
name: docker-build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: docker-build
run: |
docker build -t kubeconform .